Skip to content

Splitting one yaml into different files and setting validateSpec=false still results in parser failure #881

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
SteveGueldner opened this issue Nov 29, 2024 · 11 comments
Labels
area:client This item is related to the client extension pinned Issues and PRs that must not stale

Comments

@SteveGueldner
Copy link

Hi!

When I split an openapi.yaml like this...

openapi.yaml
... paths: /stuff: $ref: "./stuff/methods.yaml"

methods.yaml
get: tags: - stuff operationId: getStuff responses: "200": description: OK content: application/json: schema: type: string

...and set validateSpec=false compilation still says that methods.yaml is invalid because "Unrecognized token 'get'".

Additionally this is logged, which is not logged when omitting validateSpec=false:
Cannot invoke "io.swagger.v3.oas.models.OpenAPI.getExtensions()" because "openAPI" is null

Versions used:

quarkus-openapi-generator: 2.6.0-lts
Quarkus: 3.15.2
Java: 21
maven-compiler-plugin: 3.9.6

@ricardozanini
Copy link
Member

Server or Client?

@SteveGueldner
Copy link
Author

Client :-)

@ricardozanini
Copy link
Member

The subfiles are not being added to the processing IIRC, that's why it's ignoring the ValidateSpec attribute.

@SteveGueldner
Copy link
Author

This would be a really useful feature. For large API definitions splitting files totally makes sense. But I don't want to end up having 100 files in a root directory.

@SteveGueldner
Copy link
Author

I just checked how the generator behaves if I put everything in the root directory. It still throws the same exception. Of course I changed the path to the underlying yaml accordingly and set validateSpec=false.

@ricardozanini
Copy link
Member

ricardozanini commented Dec 2, 2024

@SteveGueldner feel free to submit a PR. I can help review it.

@ricardozanini ricardozanini added the area:client This item is related to the client extension label Jan 17, 2025
Copy link
Contributor

@ricardozanini @hbelmiro This is being labeled as Stale.

@github-actions github-actions bot added the Stale label Mar 19, 2025
Copy link
Contributor

@ricardozanini @hbelmiro This is being closed due to inactivity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 26, 2025
@ricardozanini ricardozanini added pinned Issues and PRs that must not stale and removed Stale labels Mar 26, 2025
@ricardozanini ricardozanini reopened this Mar 26, 2025
@z-aki
Copy link

z-aki commented Apr 9, 2025

running into this also.

@ricardozanini
Copy link
Member

@z-aki I don't have time to look into this atm. Feel free to submit a PR. It's in the resource preprocessing in the Codegen phase.

@z-aki
Copy link

z-aki commented Apr 14, 2025

worked-around this using quarkus exclude property https://docs.quarkiverse.io/quarkus-openapi-generator/dev/client.html#filter-openapi-spec-files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:client This item is related to the client extension pinned Issues and PRs that must not stale
Projects
None yet
Development

No branches or pull requests

3 participants