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

Update nested_data.py #161

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/regenerate-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ jobs:
export DJANGO_SETTINGS_MODULE=config.settings.base
python manage.py export_openapi_schema --api chord_metadata_service.mohpackets.apis.core.api | python -m json.tool > chord_metadata_service/mohpackets/docs/schema.json

- name: Convert schema to OpenAPI documentation
run: |
npx widdershins ./chord_metadata_service/mohpackets/docs/schema.json -o ./chord_metadata_service/mohpackets/docs/schema.md -u ./chord_metadata_service/mohpackets/docs/widdershins/templates/openapi3 -c true --omitHeader true
# - name: Convert schema to OpenAPI documentation
# run: |
# npx widdershins ./chord_metadata_service/mohpackets/docs/schema.json -o ./chord_metadata_service/mohpackets/docs/schema.md -u ./chord_metadata_service/mohpackets/docs/widdershins/templates/openapi3 -c true --omitHeader true

- name: Convert schema.json to schema.yml
run: python -c 'import json, yaml; json.load(open("chord_metadata_service/mohpackets/docs/schema.json")); print(yaml.dump(json.load(open("chord_metadata_service/mohpackets/docs/schema.json"))))' > chord_metadata_service/mohpackets/docs/schema.yml
# - name: Convert schema.json to schema.yml
# run: python -c 'import json, yaml; json.load(open("chord_metadata_service/mohpackets/docs/schema.json")); print(yaml.dump(json.load(open("chord_metadata_service/mohpackets/docs/schema.json"))))' > chord_metadata_service/mohpackets/docs/schema.yml

- uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: 'chord_metadata_service/mohpackets/docs/schema.*'
commit_message: Regenerate schema
commit_message: Regenerate schema
skip_fetch: true
push_options: '--force'
4 changes: 1 addition & 3 deletions chord_metadata_service/mohpackets/schemas/nested_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,7 @@ class DonorWithClinicalDataSchema(ModelSchema):
followups: List[NestedFollowUpSchema] = Field(..., alias="followup_set")
biomarkers: List[NestedBiomarkerSchema] = Field(..., alias="biomarker_set")
exposures: List[NestedExposureSchema] = Field(..., alias="exposure_set")
comorbidities_test_test_test: List[NestedComorbiditySchema] = Field(
..., alias="comorbidity_set"
)
comorbidities: List[NestedComorbiditySchema] = Field(..., alias="comorbidity_set")

class Config:
model = Donor
Expand Down