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

allOf in paths to split paths into multiple files #769

Closed
Giri-oss opened this issue Aug 25, 2016 · 5 comments
Closed

allOf in paths to split paths into multiple files #769

Giri-oss opened this issue Aug 25, 2016 · 5 comments
Labels
re-use: ref-group-combine Re-use requests involving grouping components and combining groups

Comments

@Giri-oss
Copy link

Giri-oss commented Aug 25, 2016

from 2.0 specification i can see "allOf"is applicable for only schema object, is there any specific reason for that restriction. this would be very helpful feature to split "paths" into multiple files.

i understand that it can be done today by defining path item object in different files but i am looking at keeping path and path item object in separate files. one consolidated file where i can include all paths using "allOf" and create one API document.

{
"swagger": "2.0",
"info": {
"version": "1.0.1",
"title": "Test API",
"description": "Test API description"
},
"paths": {
"allOf": [
{
"$ref": "API/ResGroup1.json#/rg1_rs1"
},
{
"$ref": "API/ResGroup1.json#/rg1_rs2"
},
{
"$ref": "API/ResGroup2.json#/rs1"
}
]
}
}

my questions are
"allOf" in paths object is it a feature that is been considered for future releases?
is there any effort already in progress to support "allOf" in paths object?

@webron
Copy link
Member

webron commented Aug 25, 2016

I see no reason to support allOf anywhere outside the Schema Object. allOf is a JSON Schema construct. The spec is not a JSON Schema. We may want to provide support for the use case, but the usage of allOf is needlessly verbose.

@Giri-oss
Copy link
Author

i understand now why "allOf" is supported only in Schema Object. approach in above is an example to express use case, i am interested in if there is already some work to support above use-case.

Thank you

@amazing-gao
Copy link

So is there any other solutions to split paths into multiple files?

@francescobianco
Copy link

@BabuGiri @webron I suggest to build file using command line toolkit that links multiple YAML files with $include tag. Look this https://github.com/javanile/yamlinc add-in project task using gulp or grunt

@handrews handrews added the $ref label Feb 24, 2020
@handrews handrews added re-use re-use: ref-group-combine Re-use requests involving grouping components and combining groups and removed $ref labels Jan 29, 2024
@handrews
Copy link
Member

Closing as duplicate of #508 (which is a slightly more general).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re-use: ref-group-combine Re-use requests involving grouping components and combining groups
Projects
None yet
Development

No branches or pull requests

5 participants