Open kazaff opened 8 years ago
I'm contemplating a similar issue with a complex application with multiple endpoints. My guess (and my current approach) is to have a pre-build script that merges multiple yaml configuration files into /api/swagger/swagger.yaml
.
I will likely namespace the definitions and endpoints in any swagger.yaml
files outside the base API definition to prevent any name collision. For example, given the following API definition layout:
swagger
└── swagger.yaml
└── user
└── swagger.yaml
A /path/foo
in swagger/user/swagger.yaml
will be merged into swagger.yaml
as /user/path/foo
and a Profile
definition in the user yaml file, as user_Profile
(or some similar convention).
It's not perfect and may be non-trivial work, so I would love to hear others' opinions on how they would approach the said problem.
@abekim talk is cheep, show me your code, haha~~ a joke, i like your approach. in my project, finally, i use the same method to solve it as yours.
my project have more than one api file, but, swagger-node only parse
swagger.yaml
by default.how to config to let it parse all yaml file that in swagger directory?