Support for multiple $refs inside a single object
See original GitHub issueIt would be really useful to be able to do something like this:
paths:
$ref: "/operations/pets.yaml" # Multiple paths
$ref: "/operations/stores.yaml" # Multiple paths
$ref: "/operations/users.yaml" # Multiple paths
Where each file includes multiple paths. For example (pets.yaml):
/pets:
post:
# ...
/pets/findByStatus:
get:
# ...
This would make it easier to organize a large API.
Edit:
It could also be an array, like this:
paths:
$ref:
- "/operations/pets.yaml"
- "/operations/stores.yaml"
- "/operations/users.yaml"
Issue Analytics
- State:
- Created 8 years ago
- Reactions:129
- Comments:37 (9 by maintainers)
Top Results From Across the Web
Using multiple refs on a single React element - Stack Overflow
A React ref is really nothing but a container for some mutable data, stored as the current property. See the React docs for...
Read more >Set multiple React refs in one variable - clubmate.fi
Storing multiple refs to an array or an object. You can use an array or an object to store React refs, depending on...
Read more >Storing Multiple Refs in an Array With React's useRef() Hook
An associative array is a convenient way to group multiple refs into a single variable. This way, each element can be accessed through...
Read more >Using $ref - Swagger
In that case, you can create a snippet for such elements in order to use them multiple times when you need it. With...
Read more >How to create an array of React refs - YouTube
Learn how to target multiple elements using React refs.
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
It’s 2021, and we still don’t have a solution for this problem. I also think that we should be (at least) able to use arrays for this.
It’s quite surprising to me that the existing standards don’t support this. I don’t suppose this is likely to change?
As for merge conflicts, if I create two equal paths with the Swagger editor, it just uses the last one. It could be the same, or it could be a setting if you want it to throw an error.
Nested paths might be an option, although it feels a bit weird having the nested paths at the same level as post/get etc.
Could
allOf
be used at all?… that may be completely incorrect or make no sense – I don’t know very much about JSON schema. 😄