-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Enhance getJsonSchema
to describe navigational properties
#2630
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
Comments
@raymondfeng mentioned that the
|
Makes sense. Maybe we can leave this out of the initial implementation and wait until there is user demand for this more complex variant? |
@samarpanB, I just assigned this issue to you, since you've indicated your interest to contribute: #1352 (comment). |
Okay @dhmlau. @bajtos, I am going to need your guidance on this. I’ll follow what you have mentioned in the description. I’ll submit in-progress PR as soon as I get to something, so that you can review and let me know if I am on right track. Also if you want to provide me some heads up, please let me know. |
@samarpanB I am happy to help, let me know if you run into any questions. |
…ational properties Enhance `getJsonSchema` to describe navigational properties fix loopbackio#2630
…ational properties Enhance `getJsonSchema` to describe navigational properties fix loopbackio#2630
…data getter to include relation fix loopbackio#2630
…data getter to include relation fix loopbackio#2630
…ational properties Enhance `getJsonSchema` to describe navigational properties fix loopbackio#2630
…data getter to include relation fix loopbackio#2630
…data getter to include relation fix loopbackio#2630
…ational properties Enhance `getJsonSchema` to describe navigational properties fix loopbackio#2630
…data getter to include relation fix loopbackio#2630
…ational properties Enhance `getJsonSchema` to describe navigational properties fix loopbackio#2630
…data getter to include relation fix loopbackio#2630
…ational properties Enhance `getJsonSchema` to describe navigational properties fix loopbackio#2630
…ational properties Enhance `getJsonSchema` to describe navigational properties fix loopbackio#2630
…ational properties Enhance `getJsonSchema` to describe navigational properties fix loopbackio#2630
…ational properties Enhance `getJsonSchema` to describe navigational properties fix loopbackio#2630
…ational properties Enhance `getJsonSchema` to describe navigational properties fix loopbackio#2630
…ational properties Enhance `getJsonSchema` to describe navigational properties fix #2630
Uh oh!
There was an error while loading. Please reload this page.
Improve the code converting LoopBack Model definitions into JSON Schema documents to optionally describe navigational properties for relations defined by the model. The decision is controlled by a new option passed to
modelToJsonSchema
andrelated methods.
Add a new property to all relation definitions. This property will signal whether the relations is targeting a single model instance (e.g. BelongsTo, HasOne) or an array of instances (e.g. HasMany).
Add a new property to
options
object used bygetJsonSchema
andmodelToJsonSchema
:export interface JsonSchemaOptions { + includeRelations?: boolean; visited?: {[key: string]: JSONSchema}; }
Modify the implementation of
modelToJsonSchema
to include navigational properties whenincludeRelations
is set.See the spike #2592 and especially the commits 2256435 for more details. Please note the commit shows changes before the review feedback was applied. You need to review the final pull request diff of the PoC before copying any code over.
This story requires us to fix handling of circular references first, see #2628.
Acceptance criteria
The text was updated successfully, but these errors were encountered: