You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manually converting the schema to OpenAPI 3 via https://editor.swagger.io/ resolves the issue for >=0.13.5, but I have not found a way to do this programmatically yet (have not looked too hard).
Ultimately, we either have to lock into datamodel-code-generator==0.13.0 as long as the Harbor spec stays on OpenAPI 2, or we have to find an easy (and automatable) way to convert the schema to OpenAPI 3 when we generate models. Having to download the schema, paste it into the Swagger Editor, download it to the correct directory, then running the just genapi command is very cumbersome, and I would like to avoid that if possible.
The text was updated successfully, but these errors were encountered:
pederhan
changed the title
Harbor API schema needs to be converted to OpenAPI 3 when generating models
Harbor API schema requires datamodel-code-generator<=0.13.0
Jun 7, 2023
datamodel-code-generator
fails to generate models from the official Harbor Swagger 2 API schema starting from version 0.13.5. datamodel-code-generator does not officially support OpenAPI 2 (a.k.a. swagger): koxudaxi/datamodel-code-generator#895Manually converting the schema to OpenAPI 3 via https://editor.swagger.io/ resolves the issue for >=0.13.5, but I have not found a way to do this programmatically yet (have not looked too hard).
Ultimately, we either have to lock into datamodel-code-generator==0.13.0 as long as the Harbor spec stays on OpenAPI 2, or we have to find an easy (and automatable) way to convert the schema to OpenAPI 3 when we generate models. Having to download the schema, paste it into the Swagger Editor, download it to the correct directory, then running the
just genapi
command is very cumbersome, and I would like to avoid that if possible.The text was updated successfully, but these errors were encountered: