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

fix: add information about foreign key and relation type #10456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaqilniz
Copy link
Contributor

@aaqilniz aaqilniz commented Apr 5, 2024

Gathering information on relationship types between models through openapi specs is hard. In particular, there is no way to distinct a hasMany and hasMany & hasManyThrough.

Along with that, there is no way to get the foreign key from openapi specs.

This PR adds two extra properties (x-foreign-key & x-relation-type) to the relationships property in openapi specs.

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

@coveralls
Copy link

coveralls commented Apr 5, 2024

Pull Request Test Coverage Report for Build 8657413748

Details

  • 56 of 72 (77.78%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.06%) to 55.432%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/repository-json-schema/src/build-schema.ts 49 65 75.38%
Files with Coverage Reduction New Missed Lines %
packages/openapi-v3/src/json-to-schema.ts 1 79.65%
Totals Coverage Status
Change from base Build 8646446166: 0.06%
Covered Lines: 9616
Relevant Lines: 12527

💛 - Coveralls

@aaqilniz aaqilniz force-pushed the fix/relation-info-in-specs branch 2 times, most recently from 64e98e3 to 3c4c5b8 Compare April 12, 2024 05:25
@aaqilniz aaqilniz marked this pull request as ready for review April 12, 2024 05:32
@aaqilniz aaqilniz requested a review from mschnee as a code owner April 12, 2024 05:32
@aaqilniz aaqilniz changed the title fix: add information about foreign key fix: add information about foreign key and relation type Aug 16, 2024
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.

None yet

2 participants