Coder Social home page Coder Social logo

adonis-swagger's People

Contributors

ahmadarif avatar ianmustafa avatar kembek avatar romulo1984 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

adonis-swagger's Issues

Support for api versions (Feature Request)

It's possible, and I think fairly common, to allow versioning an api with route groups:

ie: api/v1/[blah] and api/v2/[blah]

Would be nice if there were a good way to restrict what's included in the swagger doc by these versioned routes, so that one could generate a swagger doc for the v1 routes and a separate one for v2 routes.

Swagger - docs in yml

Hi!

How I can define a array from models in docs with yml?
image

in my YML file:

produces:
- application/json
responses:
200:
description: Retorna lista de workflows cadastrados
type: object
properties:
total:
type: string
description: Quantidade total de registros no sistema.
perPage:
type: integer
description: Quantidade de registros exibidos por página.
page:
type: integer
description: Número da página de que está sendo exibida.
lastPage:
type: integer
description: Número da última página de exibicão de dados com base nos registros por página atuais.
data:
type: array
description: Lista de Workflows referentes a pagina de dados atual.

data propertie must by an array of Workflow model

E_ROUTE_NOT_FOUND: Route not found GET /docs

After installing adonis-swagger using the instructed command adonis install adonis-swagger serving the development environment of the adonis server does not route to /docs.

However I am able to go to /swagger.json which shows the json file of the api documentation. No changes has been made to the config file or the generated files by adonis-swagger.

Tried running adonis swagger:export it was completed run the adonis server but still, unable to navigate to /docs.

The config file is recreated all times when i run adonis swagger:export

Hi,

I'm having problems in implement this plugin in my api project.

I follow the instructions to setup this extension but to make the docs available i need to run "adonis swagger:export", and this comand works but it is recreating the config/swagger.js file all the times, so if i edit this file, in the next doc export i will lose my modifications. How can i solve this?

Swagger: use dynamic schema in reusable requests

I tried to write reusable requests (post, put etc.) inside swagger.js file (just like default definitions) and use them inside yml file.

The problem is the schema related to each route is different and since the the request is defined in swagger config and used in yml many times, I cannot find a way to dynamically use related schema inside the body of each request. this is my request in yml:

/admin/order: 
 post: 
  tags: 
  - "Order"
  summary: "my summary"
  $ref: "#/reusables/post"

And this is the way I defined POST method in swagger.js file:

      definitions: {
        ...
      },
      reusables: {
        post: {
          parameters: [
            body: {
            description: "order body",
            in: 'body',
            name: 'body',
            required: true,
            schema: {  
              $ref: `#/definitions/${dynamicSchema}`
            }
          ],
          responses: {
            200: {
              description: "success res"
            }
          }
        },
      }

Is there any way I could write a request once and use multiple times for different routes?

Swagger middleware block

Hello,

Thank you for your great job. Swagger middleware works well.
It just missed the fact that swagger sould block request if it does not match with the description... Could it be implemented with Adonis ? I already made it with express and it is very usefull ! :)

Thank you :)

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.