ContributionsMost RecentMost LikesSolutionsRe: Swagger OpenAPI Code Gen "oneOf" : How to generate correct class file? No worries! We hang out in https://discord.gg/JkkXumPzcG if you ever need other help or want to test out Fern. Re: Response Object Question My team is making it easier to write specs + generate high quality code with an alternative spec. That being said, we'd be happy to help you with your Open API Spec so feel free to reach us at email. Re: Response Object Question byoungman I think you should update the JSON Model returned to your endpoint to something like this: { "results": [ { "value": "Company Zero", "matches": { "matchedNameId": "2861495", } }, { "value": "Company One", "matches": { "matchedNameId": "3423310", } }, ] "metrics": { "metric_one": "value" } } You don't want your client to be relying on specific key values such as "value0" or "matches0" because that can't be modeled in the spec (it is dynamic depending on search results) so you want to group those two things into one object. The JSON I wrote out for you can be modelled like this in Open API: responses: '200': description: OK content: 'application/json:': schema: type: array items: type: $ref/components/schemas/MyResponse components: schemas: MyResponse: properties: result: schema: type: array items: properties: value: string matches: "$ref/components/schemas/MyResponseMatch" metrics:"$ref/components/schemas/MyMetricsObj" # not shown MyResponseMatch: schema: type: object properties: matchNameId: string Re: Generated Java code (swagger) does not compile Hey ric1 -- 1) If you post your open api spec happy to help you debug in more detail.(I have heard the Native Generator: https://openapi-generator.tech/docs/generators/java works the best) 2) My team has been working on a Swagger alternative that really focuses on codegen (as Swagger was initially built for docs) and we are calling it Fern. Repo here. Demo video here. It is as easy as npm install -g fern-api (to install) fern init # initializes a basic fern api fern add java # adds java generator fern generate Re: Swagger OpenAPI Code Gen "oneOf" : How to generate correct class file? Hey zur -- I have hit similar issues and couple of things you can try: 1. Changing the generator and possibly using OpenAPI (I have heard the Native Generator: https://openapi-generator.tech/docs/generators/java works the best) 2. My team has been working on a Swagger alternative that really focuses on codegen (as Swagger was initially built for docs) and we are calling it Fern. Check it out here. In Fern you can represent the issuer like this: Issuer: union: stringIssuer: string objectIssuer: ObjectIssuer ObjectIssuer: fields: id: string and it will codegen the classes you want. Demo video here. Apologies if this wasn't the answer you are looking for but I have run into many issues with codegen in the Swagger ecosystem and using an alternative feels like the best solution.