Generate Web API Documentation from PHP Code

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1778
    philsturgeon
    Participant

    Generate Web API Documentation from PHP Code

    #1779
    wackmaniac
    Guest

    I’m a fan of generating the OpenAPI specification from code as it keeps the API specs close to the code. When creating a specification manually you can easily forget to update it when making changes to the API code.

    A downside of libraries like `swagger-php` in my opinion is that your code becomes “polluted ” with annotations and that I’ve found that I sometimes have to deviate from my regular way of writing code to ensure the OpenAPI specification that is generated is correct.

    #1780
    hparadiz
    Guest

    More than just API documentation Swagger also generates an OpenAPI yaml file that you can feed into Swagger codegen to generate client libraries for your API in dozens of languages.

    #1781
    systematical
    Guest

    Just gonna hold this out there if anyone is on CakePHP: https://github.com/cnizzardini/cakephp-swagger-bake and this which is a full API library for Cake: https://mixerapi.com

    It generates most of your OpenAPI direct from existing routes and models.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.