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

Rewrite code generation and upgrade to Pydantic v2 #60

Merged
merged 85 commits into from
Dec 19, 2023
Merged

Conversation

pederhan
Copy link
Member

@pederhan pederhan commented Sep 7, 2023

Rewrites the code generation functionality and migrates all models to use Pydantic V2.

Code Generation

All code generation files are now located in the codegen directory.
The following new Hatch scripts have been added:

  • generate-main: Generate main API models
  • generate-scanner: Generate scanner API models
  • generate: Generate all models (runs generate-main and generate-scanner)

The existing Justfile has been deleted as a result of migrating these scripts to Hatch.

Pydantic V2

Models have been changed to use Pydantic V2, which includes changes to validators and aliases. Changes are documented in the changelog.

Other

  • Pre-commit now formats source files with Ruff instead of Black.

@pederhan pederhan marked this pull request as ready for review December 19, 2023 14:06
@pederhan pederhan changed the title Pydantic v2 Rewrite code generation and upgrade to Pydantic v2 Dec 19, 2023
Overwrite models.VulnerabilityItem with models.scanner.VulnerabilityItem
@pederhan pederhan merged commit 9cad879 into main Dec 19, 2023
4 checks passed
@pederhan pederhan deleted the pydantic-v2 branch December 19, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Harbor API schema requires datamodel-code-generator<=0.13.0
1 participant