Closed JeroenDeDauw closed 8 years ago
Could / should use swagger spec
https://github.com/swagger-api/swagger-spec http://swagger.io/specification/
Seems like there are two obvious options:
The former has the advantage of putting the information close to the routes. The later has the advantage of not having to use some magical docblock syntax with no editor support whatsoever.
Apparently maintaining it in YAML (from which the JSON can be generated) is also an option: http://swagger.io/swagger-editor/
swagger-php has Silex integration via https://github.com/jdesrosiers/silex-swagger-provider
This might also be useful: https://github.com/kbrabrand/silex-swagger-ui
They both appear to be somewhat out of date though
As far as I can tell, going with the (non-generated) JSON is the simplest and perhaps also easiest approach. Using something like silex-swagger-ui would be good, since else the UI files need to be added to the repo. There is a fork of silex-swagger-ui that has the latest version of the Swagger UI, see https://github.com/kbrabrand/silex-swagger-ui/issues/6
The posts at https://github.com/jdesrosiers/silex-swagger-provider/issues/9 suggest Swagger might not be so good for our use case and that http://json-schema.org/ might be better. I've heard good things about json-schema.org for documenting REST APIs before.
The API is self-documents its endpoints to some extend. This is however not very detailed and other classes of information are needed by consumers.
GitHub API docs: https://developer.github.com/v3/