You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
In my specification I have a "oneOf" relation between two components, a interface ExINterface and a class ExObject1 implementing this interface (see specification snippet below).
When generating the code out of the specification with plugin version 7.12.0 I get the expected result:
public class ExObject1 implements ExInterface
But when generating the code with plugin version 7.13.0, the generated class does not implement the interface:
public class ExObject1
The interface class itself is not even generated.
openapi-generator version
v7.13.0
OpenAPI declaration file content or url
openapi: 3.0.3info:
title: Example APIdescription: This is an example API specification serving as error reproducerversion: 1.0.0paths:
/example:
get:
summary: Example endpointdescription: This is an example endpointoperationId: getExampleparameters:
- name: exampleParamin: queryrequired: truedescription: An example query parameterschema:
type: stringresponses:
'200':
description: Successful responsecontent:
application/json:
schema:
$ref: '#/components/schemas/ExInterface'components:
schemas:
ExInterface:
oneOf:
- $ref: '#/components/schemas/ExObject1'ExObject1:
type: objectproperties:
name:
type: stringdescription: The name of the object
This is tied to my fix here #21043. It fixed so that the generator normalization is now working as advertised. If it is of interest to get an interface for a oneOf with a single subSchema, then I would investigate turning off the SIMPLIFY_ONEOF_ANYOF normalization.
Thank you for clarification.
Unfortunately, it seems not to be straight forward, to disable the normalization when using the openapi-generator-gradle-plugin.
At least I could not find an according configuration option.
Uh oh!
There was an error while loading. Please reload this page.
Bug Report Checklist
Description
In my specification I have a "oneOf" relation between two components, a interface ExINterface and a class ExObject1 implementing this interface (see specification snippet below).
When generating the code out of the specification with plugin version 7.12.0 I get the expected result:
public class ExObject1 implements ExInterface
But when generating the code with plugin version 7.13.0, the generated class does not implement the interface:
public class ExObject1
The interface class itself is not even generated.
openapi-generator version
v7.13.0
OpenAPI declaration file content or url
Generation Details
Using the following code gen options:
Steps to reproduce
Calling "./gradlew openapiGenerate" and reviewing the generated class "ExObject1".
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: