feathersjs-ecosystem / feathers-swagger

Add documentation to your FeatherJS services and feed them to Swagger UI.
MIT License
225 stars 63 forks source link

Space in name leads to non RFC3986-compliant percent-encoded URI #109

Closed andys8 closed 5 years ago

andys8 commented 6 years ago

Issue

Lists contain a space in their name. Using editor this is not allowed.

Solution

space could be replaced with dash (-) or another character.

Error

Semantic error at paths./campaigns.get.responses.200.schema.$ref $ref values must be RFC3986-compliant percent-encoded URIs

Code

Name with space used for lists: https://github.com/feathersjs-ecosystem/feathers-swagger/blob/e61b2852f728485e3a7ec82abd16de51b8bf5538/lib/index.js#L143

Generated here: https://github.com/feathersjs-ecosystem/feathers-swagger/blob/e61b2852f728485e3a7ec82abd16de51b8bf5538/lib/index.js#L105

andys8 commented 6 years ago

This lead to an actual problem, when generating code using open API tools or swagger codegen. Filenames and types will be created using spaces, which is syntactically incorrect.