Field references
See original GitHub issueI can’t find a firm declaration on this, but I can see it in SwaggerUI, so my question is, is this considered a valid supported way to define that a field in object1 relates to a field in object2.
To say that the photo::album_id field, relates to the album::id field.
So generated code can automatically organize multiple lists of objects.
"definitions": {
"photo": {
"type": "object",
"properties": {
"id": { "type": "integer" },
"album_id": { "$ref": "#/definitions/album/properties/id" }
},
},
"album": {
"type": "object",
"properties": {
"id": { "type": "integer" }
},
},
},
If this is valid, or some other way is valid; can an a usage please be added to the examples?
And if not valid then can this or something similar be added?
thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:23 (2 by maintainers)
Top Results From Across the Web
Field References - KeePass Password Safe
Note that field references are intended for referencing data stored in different entries. If you want to insert data from the same/current entry,...
Read more >ESQL field references overview - IBM
An ESQL field reference is a sequence of period-separated values that identify a specific field (which might be a structure) within a ...
Read more >Reference Fields - Catalytic Help Center
You can insert references to fields in places like instructions, the body of an email, and when configuring actions. These field references dynamically ......
Read more >Using Field References - Ivanti
The simplest field reference is a field name. To reference a field within the current business object, refer to the name of the...
Read more >Field References Deep Dive | Logstash Reference [master]
It is often useful to be able to refer to a field or collection of fields by name. To do this, you can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@gareth-ib you do not design your APIs this way, there is no notion of a foreign key reference. Just make it also an integer and keep in mind that it is actually a reference to an instance of type album.
@silkentrance But data always has the concept of related data. So an API with lots of different objects being passed through it will have a myriad of relational concepts.
country
,state
,city
,address
,member
,profile
, anything… So ideally there would be a way to document and generate handlers for that instead of the client programmers needing to learn all the relations that exist in an entire API system. Example a list of 50 profiles, all with acountry_id
, and separately a unique list of their countries as full objects, which ends up being 2 instances of the country object. As opposed to a client project needing to pre-hard-code relations between objects