unioslo / harborapi

Python async client for the Harbor REST API v2.0.
https://unioslo.github.io/harborapi/
MIT License
28 stars 5 forks source link

Generate models from OpenAPI v3 schema #57

Closed pederhan closed 1 year ago

pederhan commented 1 year ago

This PR adds automatic conversion of the Harbor OpenAPI v2 schema to OpenAPI v3 by using the Swagger converter API:

https://converter.swagger.io/api/convert?url=OAS2_YAML_OR_JSON_URL

This lets us use newer versions of datamodel-code-generator, instead of being locked into version 0.13.0.

For now, we still generate Pydantic V1 models, but this is an important step in moving to Pydantic V2 in the near future.

Closes #54

pederhan commented 1 year ago

This PR is being scrapped in favor of working on the pydantic-v2 branch. There is no point doing all this work , only to migrate to Pydantic V2 right after (thereby rendering a lot of this work obsolete). The new code generation code has been incorporated into the pydantic-v2 branch.