Skip to content
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

Generated yaml document is in wrong format when the path length reach 128+ bytes #1456

Closed
IonRabii opened this issue May 4, 2023 · 1 comment · Fixed by #1458
Closed
Labels
bug Something isn't working

Comments

@IonRabii
Copy link

IonRabii commented May 4, 2023

I have a simple resource class with a simple POST api.
I try to generate openapi documentation and download it as a yaml file.
When the path length doesn't reach 128 byte, the generated file is ok,
but, if the path length reach the 128+ bytes, the generated file is in an wrong format.

below is an example:

@Path("/api/v1/internal/export/{aaaa_id}/customers/{bbbbbbbb_id}/xxxxxxxxxxxxxxxxxxxxxxxy/{ccccccccccccccc_id}/{ddddddddddddddddddd_id}") (length: 128) --> the generated openapi yaml file is in a wrong format

Generated file: generated_file_wrong_format

@Path("/api/v1/internal/export/{aaaa_id}/customers/{bbbbbbbb_id}/xxxxxxxxxxxxxxxxxxxxxxx/{ccccccccccccccc_id}/{ddddddddddddddddddd_id}") (length: 127) --> the generated openapi yaml file is ok

Generated file: generated_file_format_ok

@MikeEdgar MikeEdgar added the bug Something isn't working label May 4, 2023
@MikeEdgar
Copy link
Member

MikeEdgar commented May 4, 2023

Reference why this is happening: https://yaml.org/spec/1.1/#id934761

The default value in snakeyaml to use explicit keys is length of 128. We can increase this or make it configurable perhaps.

https://www.javadoc.io/doc/org.yaml/snakeyaml/latest/org/yaml/snakeyaml/DumperOptions.html#setMaxSimpleKeyLength(int)

MikeEdgar added a commit to MikeEdgar/smallrye-open-api that referenced this issue May 4, 2023
Fix smallrye#1456

Signed-off-by: Michael Edgar <michael@xlate.io>
gastaldi added a commit to gastaldi/smallrye-open-api that referenced this issue May 5, 2023
MikeEdgar added a commit that referenced this issue May 5, 2023
Fix #1456

Signed-off-by: Michael Edgar <michael@xlate.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants