Replies: 4 comments 1 reply
-
In general, you cannot define That said, if you have an issue with the generated code, you'd need to file an issue in repository of the project you use. This repository is meant only for issues related to spec itself. |
Beta Was this translation helpful? Give feedback.
-
Below are the changes made as per your suggestions. Still its not resolved. responses:
'200':
description: OK
headers:
authorization:
schema:
$ref: '#/components/securitySchemes/BearerAuth'
description: Oneview Api token
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer Moreover, there is no response for this api, so the generated client api is throwing exception at catch block since return value is null. how can that be fixed? try {
return CompletableFuture.completedFuture(
null
);
} catch (IOException e) {
return CompletableFuture.failedFuture(new ApiException(e));
} If this is not the right repository, can you tell me the repository where I can raise the issue? My sample client generator config, <execution>
<id>XXX</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>
${project.basedir}/src/main/resources/swagger-spec/client/XXX-api.yaml
</inputSpec>
<generatorName>java</generatorName>
<library>native</library>
<output>${project.basedir}</output>
<generateApis>true</generateApis>
<generateApiTests>false</generateApiTests>
<generateApiDocumentation>false</generateApiDocumentation>
<generateModels>true</generateModels>
<generateModelTests>false</generateModelTests>
<generateModelDocumentation>false</generateModelDocumentation>
<generateSupportingFiles>true</generateSupportingFiles>
<apiPackage>XYZ</apiPackage>
<invokerPackage>XYZ</invokerPackage>
<modelPackage>XYZ</modelPackage>
<addCompileSourceRoot>true</addCompileSourceRoot>
<configOptions>
<java8>true</java8>
<dateLibrary>java8</dateLibrary>
<delegatePattern>true</delegatePattern>
<useBeanValidation>true</useBeanValidation>
<performBeanValidation>true</performBeanValidation>
<configPackage>XYZ</configPackage>
<interfaceOnly>true</interfaceOnly>
<sortParamsByRequiredFlag>false</sortParamsByRequiredFlag>
<debugOperations>true</debugOperations>
<debugModels>true</debugModels>
<debugOpenAPI>true</debugOpenAPI>
<asyncNative>true</asyncNative>
<debugSupportingFiles>true</debugSupportingFiles>
</configOptions>
</configuration>
</execution> Please guide to resolve the issue as its blocking my work |
Beta Was this translation helpful? Give feedback.
-
@webron, My swagger worked without making any change even the old code definition for header worked. Found the fix from the issues reported on openAPItool and the fix was provided on 5.2.0. After using that version it worked. Client code regenerated to return headers. Thank you very much for your time and support |
Beta Was this translation helpful? Give feedback.
-
Issue resolved, closing. |
Beta Was this translation helpful? Give feedback.
-
I have defined the swagger in order to get the authorization token from the response header which can be used for next api call. However when I generate the client code out of swagger, it return only response body and not the header. I Have tried all the search but nothing was helpful.
Part of the swagger definition,
Client Api generate: ( the method body doesnt have any code for response header"
If you could provide any insight that would be more helpfull
Beta Was this translation helpful? Give feedback.
All reactions