Skip to content

Replace python dataclasses with pydantic dataclasses - #674

Merged
ahouseholder merged 12 commits into
mainfrom
feature/use_pydantic
Jan 27, 2025
Merged

ahouseholder merged 12 commits into
mainfrom
feature/use_pydantic

Conversation

@ahouseholder

Copy link
Copy Markdown
Contributor

Rationale:

  • sets us up for future FastAPI microservice development
  • removes dependency on dataclasses-json
  • improves our ability to use validators on object creation

ahouseholder and others added 6 commits January 24, 2025 10:58
* fix unit test

* add some comments explaining why we're doing it this way

also use with... syntax to reduce filehandler boilerplate
makes json roundtrip easier
also prepares for FastAPI adoption

# Conflicts:
#	src/ssvc/_mixins.py
#	src/ssvc/decision_points/cvss/base.py
#	src/ssvc_v2.py
@ahouseholder ahouseholder self-assigned this Jan 24, 2025
@ahouseholder ahouseholder added enhancement New feature or request tools Software Tools labels Jan 24, 2025
@ahouseholder ahouseholder added this to the 1Q25 milestone Jan 24, 2025
Comment thread src/cvss_to_json.py
Comment thread src/outcomes_to_json.py

@ahouseholder ahouseholder left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole commit was just me regenerating the json files with the fixed scripts

@sei-vsarvepalli sei-vsarvepalli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pydantic it is now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tools Software Tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch from python dataclasses to pydantic BaseModel dataclasses

2 participants