Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Swagger docs for the full API #750

@dberesford

Description

@dberesford

This PR landed Swagger support for Hapi: CoderDojo/cp-zen-platform#709. Internally uses the Hapi-Swagger module.

To see it in action, open http://localhost:8000/documentation

The PR also has just one example of how to add Swagger config to a route API:

https://github.com/CoderDojo/cp-zen-platform/blob/93d06f8530ff9c5afbb62ed3a2edf59ac04b4255/lib/sys.js#L11-L15

The remainder of the API needs to be documented in a similar fashion, a non-trivial amount of work! All the routes in nearly all the files in https://github.com/CoderDojo/cp-zen-platform/tree/master/lib.

Furthermore, Joi validation should to be added to most endpoints, if this is in place it both validates the API parameters as well as feeding in to the Swagger docs (a double win!). See http://hapijs.com/tutorials/validation.

For more on Swagger, see Swagger.io.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions