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

feat(layer)!: use pydantic models #517

Merged
merged 7 commits into from
Mar 22, 2023
Merged

feat(layer)!: use pydantic models #517

merged 7 commits into from
Mar 22, 2023

Conversation

matthiasschaub
Copy link
Collaborator

@matthiasschaub matthiasschaub commented Mar 21, 2023

Description

Layer/Topic are now pydantic models instead of dataclasses. This is in preperation to use Layer/Topic models as response models in FastAPI. FastAPI will use this return type to:

  • Validate the returned data.
  • Add JSON Schema for the response, in the OpenAPI path operation.
  • It will limit and filter the output data to what is defined in the return type.

For more details see here

BREAKING CHANGE:

  • requests to the API endpoint /indicator for a custom layer/topic
    need an additional field key of type string

Checklist

  • I have updated my branch to main (e.g. through git rebase main)
  • My code follows the style guide and was checked with pre-commit before committing
  • I have commented my code
  • I have added sufficient unit and integration tests
  • I have updated the CHANGELOG.md

@matthiasschaub matthiasschaub force-pushed the api-metadata branch 4 times, most recently from 6141004 to 7c93d6e Compare March 21, 2023 09:08
@matthiasschaub matthiasschaub marked this pull request as ready for review March 21, 2023 09:08
Layer/Topic are now pydantic models instead of dataclasses

BREAKING CHANGE:
- requests to the API endpoint `/indicator` for a custom layer/topic
need an additional field `key` of type string
@matthiasschaub matthiasschaub added enhancement New feature or request breaking This will break previous versions. Documentation and Changelog update compulsory api topic labels Mar 21, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
workers/tests/unittests/test_layer.py Outdated Show resolved Hide resolved
workers/tests/unittests/test_layer.py Show resolved Hide resolved
@matthiasschaub matthiasschaub merged commit 5c84537 into main Mar 22, 2023
@matthiasschaub matthiasschaub deleted the api-metadata branch March 22, 2023 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api breaking This will break previous versions. Documentation and Changelog update compulsory enhancement New feature or request topic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants