quarkus-openapi-generator icon indicating copy to clipboard operation
quarkus-openapi-generator copied to clipboard

Server Code Generation does not support multiple yaml files

Open Rishabh9193 opened this issue 9 months ago • 1 comments

Hi team

My open api spec is structured as follows

common
  -- common-spec.yaml
module1
  -- module1.yaml
module2
  -- module2.yaml

module1.yaml could use component/schema elements from common-spec.yaml. Before running the generation logic, I copy the common file common-spec.yaml and module1.yaml to a temp location and then run the code generation logic. This works for client code generation but fails for server code generation.

Server Config (fails):

<quarkus.openapi.generator.input-base-dir>/tmp/download/api-specs</quarkus.openapi.generator.input-base-dir>
<quarkus.openapi.generator.spec>module1.yaml</quarkus.openapi.generator.spec>

Client Config (works):

<quarkus.openapi-generator.codegen.input-base-dir>/tmp/download/api-specs</quarkus.openapi-generator.codegen.input-base-dir>
<quarkus.openapi-generator.codegen.include>module1.yaml</quarkus.openapi-generator.codegen.include>

I have tried going through the code base, I believe the issue is here https://github.com/quarkiverse/quarkus-openapi-generator/blob/main/server/deployment/src/main/java/io/quarkiverse/openapi/server/generator/deployment/codegen/ApicurioOpenApiServerCodegen.java#L88 - where we generate json file only for the input file and not other files in the /tmp/download/api-specs directory.

Since the behaviour here is inconsistent between server and client code generation - is this something to be implemented/fixed? If not, do we have any workaround for the same?

Rishabh9193 avatar Feb 07 '25 08:02 Rishabh9193

@carlesarnal please take a look

ricardozanini avatar Feb 07 '25 16:02 ricardozanini

@ricardozanini @hbelmiro This is being labeled as Stale.

github-actions[bot] avatar Apr 09 '25 12:04 github-actions[bot]

@mcruzdev are you going to take this one too?

ricardozanini avatar Apr 09 '25 13:04 ricardozanini

@vladprado can you try this one? I can help you with some details.

mcruzdev avatar Apr 09 '25 13:04 mcruzdev

Sure, @mcruzdev ! Assign it to me.

vladprado avatar Apr 09 '25 18:04 vladprado

Nice @vladprado, just to give you a context... the server extension uses behind the scenes apicurio/apicurio-codegen project. Please, if necessary crest an issue there :)

mcruzdev avatar Apr 09 '25 20:04 mcruzdev

@ricardozanini @hbelmiro This is being labeled as Stale.

github-actions[bot] avatar Jun 09 '25 12:06 github-actions[bot]

@mcruzdev @ricardozanini Sorry for disappearing for so long. I will review this issue in the next few days and get back to it.

vladprado avatar Aug 07 '25 23:08 vladprado

No worry @vladprado , take your time... let me know if you have any question.

mcruzdev avatar Sep 15 '25 15:09 mcruzdev

Hi there. Any updates on this issue?

lazno avatar Sep 26 '25 11:09 lazno

@lazno i was looking into it but I will be out till mid-October.

vladprado avatar Sep 26 '25 11:09 vladprado

@ricardozanini @hbelmiro This is being labeled as Stale.

github-actions[bot] avatar Nov 25 '25 12:11 github-actions[bot]