Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • All the RESTful API must follow Swagger Specification: http://swagger.io/specification
  • The ONAP-Components must provide swagger files for its RESTful API definitions, there are two possible approaches.
    • The developers write the Swagger file, then use CI system to generate the stub codes for implementation.
    • The developers write the Swagger annotation in the source codeI, then use CI system to generate the Swagger file.
  • The Swagger file should be placed under a specific URL the base url of the microservice host service so the API definition could be discovered by clients or management tools at runtime. 
    For example, if the base url of peststore service is /api/petstore/v1/, the URL of swagger file is  /api/petstore/v1/Swagger.json

Versioning

API is a public contract between a Server and a Consumer, so it's crucial to make sure the changes are backwards compatible. We need to introduce new versions of the API while still allowing old versions to be accessible when it's necessary. So a versioning mechanism should be considered.

...

  • Standard HTTP status codes

200 – OK – Eyerything Everything is working
201 – OK – New resource has been created
204 – OK – The resource was successfully deleted

...