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

refactor: move Record and Response schemas to his own file and unify canonical schemas for them #4482

Conversation

jfcalvo
Copy link
Member

@jfcalvo jfcalvo commented Jan 11, 2024

Description

This is the first of a collection of PRs that will include changes to our Pydantic schemas used by our API v1 endpoints.

The changes included in this PR are the following:

  • Now we have only one Record canonical schema used by all API v1 endpoints.
    • The schemas related with records has been moved to schemas/v1/records.py module.
    • The canonical Record schema is now including dataset_id as attribute in all cases.
  • Now we have only one Response canonical schema used by all API v1 endpoints.
    • The schemas related with responses has been moved to schemas/v1/responses.py module.
    • The canonical Response schema is now including record_id as attribute in all cases.

Refs #4407

Type of change

(Please delete options that are not relevant. Remember to title the PR according to the type of change)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (change restructuring the codebase without changing functionality)
  • Improvement (change adding some improvement to an existing functionality)
  • Documentation update

How Has This Been Tested

  • Running and modifying unit tests.

Checklist

  • I added relevant documentation
  • follows the style guidelines of this project
  • I did a self-review of my code
  • I made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I filled out the contributor form (see text above)
  • I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/)

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. area: api Indicates that an issue or pull request is related to the Fast API server or REST endpoints language: python Pull requests or issues that update Python code team: backend Indicates that the issue or pull request is owned by the backend team type: refactor Indicates internal refactoring of the code-base labels Jan 11, 2024
@frascuchon frascuchon self-requested a review January 12, 2024 08:12
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 12, 2024
@jfcalvo jfcalvo merged commit 32a49ca into refactor/api-v1-schemas-unification Jan 12, 2024
2 checks passed
@jfcalvo jfcalvo deleted the refactor/api-v1-schemas-unification-records branch January 12, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api Indicates that an issue or pull request is related to the Fast API server or REST endpoints language: python Pull requests or issues that update Python code lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files. team: backend Indicates that the issue or pull request is owned by the backend team type: refactor Indicates internal refactoring of the code-base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants