Skip to content

Server Code Generation does not support multiple yaml files #983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Rishabh9193 opened this issue Feb 7, 2025 · 6 comments
Open

Server Code Generation does not support multiple yaml files #983

Rishabh9193 opened this issue Feb 7, 2025 · 6 comments
Assignees
Labels
area:server This item is related to the server extension

Comments

@Rishabh9193
Copy link

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?

@ricardozanini ricardozanini added the area:server This item is related to the server extension label Feb 7, 2025
@ricardozanini
Copy link
Member

@carlesarnal please take a look

Copy link
Contributor

github-actions bot commented Apr 9, 2025

@ricardozanini @hbelmiro This is being labeled as Stale.

@github-actions github-actions bot added the Stale label Apr 9, 2025
@ricardozanini
Copy link
Member

@mcruzdev are you going to take this one too?

@mcruzdev
Copy link
Member

mcruzdev commented Apr 9, 2025

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

@vladprado
Copy link
Contributor

Sure, @mcruzdev !
Assign it to me.

@mcruzdev
Copy link
Member

mcruzdev commented Apr 9, 2025

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:server This item is related to the server extension
Projects
None yet
Development

No branches or pull requests

4 participants