Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import org.springframework.web.client.RestClient;
import org.springframework.web.client.support.RestClientAdapter;
{{/reactive}}
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import {{javaxPackage}}.annotation.Generated;

{{>generatedAnnotation}}

public abstract class HttpInterfacesAbstractConfigurator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import {{apiPackage}}.{{classname}};

import org.springframework.context.annotation.Bean;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import {{javaxPackage}}.annotation.Generated;

{{>generatedAnnotation}}

public abstract class HttpInterfacesAbstractConfigurator {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7164,6 +7164,37 @@ public void testPathConstantGeneratedForSpringHttpInterfaceLibrary() throws IOEx
.containsWithNameAndAttributes("HttpExchange", ImmutableMap.of("value", "PetApi.PATH_GET_PET_BY_ID"));
}

@Test
public void testHttpInterfacesAbstractConfiguratorIsGenerated() throws IOException {
final SpringCodegen defaultConfiguratorCodegen = new SpringCodegen();
defaultConfiguratorCodegen.setLibrary(SPRING_HTTP_INTERFACE);
defaultConfiguratorCodegen.setUseSpringBoot3(true);

final Map<String, File> defaultConfiguratorFiles = generateFiles(
defaultConfiguratorCodegen, "src/test/resources/3_0/petstore.yaml");

assertGeneratedAnnotation(defaultConfiguratorFiles.get("HttpInterfacesAbstractConfigurator.java"));

final SpringCodegen proxyFactoryConfiguratorCodegen = new SpringCodegen();
proxyFactoryConfiguratorCodegen.setLibrary(SPRING_HTTP_INTERFACE);
proxyFactoryConfiguratorCodegen.setUseSpringBoot3(true);
proxyFactoryConfiguratorCodegen.setUseHttpServiceProxyFactoryInterfacesConfigurator(true);

final Map<String, File> proxyFactoryConfiguratorFiles = generateFiles(
proxyFactoryConfiguratorCodegen, "src/test/resources/3_0/petstore.yaml");

assertGeneratedAnnotation(proxyFactoryConfiguratorFiles.get("HttpInterfacesAbstractConfigurator.java"));
}

private void assertGeneratedAnnotation(File file) {
JavaFileAssert.assertThat(file)
.hasImports("jakarta.annotation.Generated")
.assertTypeAnnotations()
.containsWithNameAndAttributes("Generated", ImmutableMap.of(
"value", "\"org.openapitools.codegen.languages.SpringCodegen\""
));
}

@Test
public void testClientRegistrationIdAnnotationNotPresentWhenNotConfigured() throws IOException {
final SpringCodegen codegen = new SpringCodegen();
Expand Down
12 changes: 11 additions & 1 deletion samples/client/others/go/oneof-not-enum/docs/EnumNullUnion.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Kind** | Pointer to **string** | | [optional]
**Kind** | Pointer to **NullableString** | | [optional]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: EnumNullUnion is a oneOf wrapper, not a model with a Kind property; the generated type contains only NullableEnum and NullableExcludedEnum. The added property and SetKindNil/UnsetKind entries document APIs that do not exist on this type; document the union alternatives instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At samples/client/others/go/oneof-not-enum/docs/EnumNullUnion.md, line 7:

<comment>`EnumNullUnion` is a oneOf wrapper, not a model with a `Kind` property; the generated type contains only `NullableEnum` and `NullableExcludedEnum`. The added property and `SetKindNil`/`UnsetKind` entries document APIs that do not exist on this type; document the union alternatives instead.</comment>

<file context>
@@ -4,7 +4,7 @@
 Name | Type | Description | Notes
 ------------ | ------------- | ------------- | -------------
-**Kind** | Pointer to **string** |  | [optional] 
+**Kind** | Pointer to **NullableString** |  | [optional] 
 
 ## Methods
</file context>


## Methods

Expand Down Expand Up @@ -50,6 +50,16 @@ SetKind sets Kind field to given value.

HasKind returns a boolean if a field has been set.

### SetKindNil

`func (o *EnumNullUnion) SetKindNil(b bool)`

SetKindNil sets the value for Kind to be an explicit nil

### UnsetKind
`func (o *EnumNullUnion) UnsetKind()`

UnsetKind ensures that no value is present for Kind, not even an explicit nil

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import org.springframework.web.client.RestClient;
import org.springframework.web.client.support.RestClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import jakarta.annotation.Generated;

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public abstract class HttpInterfacesAbstractConfigurator {

private final RestClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import org.springframework.web.client.RestClient;
import org.springframework.web.client.support.RestClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import jakarta.annotation.Generated;

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public abstract class HttpInterfacesAbstractConfigurator {

private final RestClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import org.springframework.web.client.RestClient;
import org.springframework.web.client.support.RestClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import jakarta.annotation.Generated;

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public abstract class HttpInterfacesAbstractConfigurator {

private final RestClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.support.WebClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import jakarta.annotation.Generated;

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public abstract class HttpInterfacesAbstractConfigurator {

private final WebClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.support.WebClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import jakarta.annotation.Generated;

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public abstract class HttpInterfacesAbstractConfigurator {

private final WebClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.support.WebClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import jakarta.annotation.Generated;

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public abstract class HttpInterfacesAbstractConfigurator {

private final WebClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import org.springframework.web.client.RestClient;
import org.springframework.web.client.support.RestClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import jakarta.annotation.Generated;

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public abstract class HttpInterfacesAbstractConfigurator {

private final RestClient client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

import org.springframework.context.annotation.Bean;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import jakarta.annotation.Generated;

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public abstract class HttpInterfacesAbstractConfigurator {

private final HttpServiceProxyFactory factory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import org.springframework.web.client.RestClient;
import org.springframework.web.client.support.RestClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import jakarta.annotation.Generated;

@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.26.0-SNAPSHOT")
public abstract class HttpInterfacesAbstractConfigurator {

private final RestClient client;
Expand Down
Loading