Code Monkey home page Code Monkey logo

extended-api-doc-bundle's Introduction

Extended Api Doc Bundle

An extension for nelmio/api-doc-bundle that improves the sorting of endpoints by tags and provides minor stylistic corrections to the original Nelmio view.

Installation

Required bundles:

composer require symfony/asset
composer require symfony/twig-bundle
composer require nelmio/api-doc-bundle
composer require pbaszak/extended-api-doc-bundle

Routing Registration:

  • /api/doc
  • /api/doc.json
  • /api/doc.yaml
# config/routes.yaml
...
extended_api_doc:
    resource: '@ExtendedApiDocBundle/Resources/routes/*'

Setup metainfo:

# config/packages/nelmio_api_doc.yaml
parameters:
    app_title: '%env(APP_TITLE)%'
    app_description: '%env(APP_DESCRIPTION)%'
    app_version: '%env(APP_VERSION)%'
    app_commit_sha_short: '%env(APP_COMMIT_SHA_SHORT)%'

nelmio_api_doc:
    documentation:
        info:
            title: '%app_title%'
            description: '%app_description%'
            version: '%app_version% (%app_commit_sha_short%)'
    areas: # to filter documented areas
        path_patterns:
            - ^/api(?!/doc(.json|.yaml)?$)

Usage

Just open /api/doc path on Your server and enjoy!

alt text

Development

How to start

Start local environment using this command:

bash start.sh

How to use Standard Version

If You don't have node_modules directory run:

npm install

Major, Minor, Patch version update:

npm run version:major
# or
npm run version:minor
# or
npm run version:patch

Push tags:

npm run version:release
# or
npm run release

Check package.json for understand what commands do.

How to use PHPStan

Main command:

docker exec php composer code:analyse

but, if You need to add errors to ignored:

docker exec php composer code:analyse:b

How to use PHP CS Fixer

docker exec php composer code:fix

How to use XDebug in Visual Studio Code

Create new file in Your project: .vscode/launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for xDebug",
            "type": "php",
            "request": "launch",
            "port": 5902,
            "hostname": "0.0.0.0",
            "pathMappings": {
                "/app/": "${workspaceRoot}"
            }
        }
    ]
}

Uncomment environments in .env.local:

XDEBUG_MODE=develop,debug
XDEBUG_CONFIG=" client_port=5902 idekey=VSCODE client_host=host.docker.internal discover_client_host=0 start_with_request=yes"

Type Ctrl + Shift + D and run Listen for xDebug.

extended-api-doc-bundle's People

Contributors

patrykbaszak avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.