4 ms·
How so? At least in my experience, Swagger doesn't have anything equivalent to traits so there's no way to DRY out your docs. If you have 50 endpoints with pagi
by xiaoma 10y ago
How so? At least in my experience, Swagger doesn't have anything equivalent to traits so there's no way to DRY out your docs. If you have 50 endpoints with pagination, you have to document how that works 50 times. If you change how pagination queries are structured, then you have to change your docs in 50 places. With RAML, you would just change the trait and then all of your docs and your automated testing against them will be updated.
Swagger does have $ref, but it's a much weaker abstraction than RAML traits and resourceTypes.
http://raml.org/developers/raml-200-tutorial#traits http://raml.org/developers/raml-200-tutorial#traits
- pbowyer 10y agohttp://stoplight.io/ http://stoplight.io/ lets you use traits in Swagger. I've really enjoyed using a visual tool to build the API definition, though I don't find it helps with writing documentation.