ahmadarif / adonis-swagger Goto Github PK
View Code? Open in Web Editor NEWSwagger provider for Adonis 4.x
Swagger provider for Adonis 4.x
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.
Hi,
We are currently using ALB for our services. Each microservice is in a path.
For example:
It would be helpful for us if we could change the path of the docs to:
Instead of:
Thank you!
I already have some endpoints created, like update to appear in doc?
Hi!
How I can define a array from models in docs with yml?
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
i'm using configure from original repo is working. but exist error at right bottom "ERROR"
My API is in Dev and Prod, I wanted to block the swagger (urlAPi / docs) how?
how to configure swagger with JWT to make requests with a token?
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
.
Hello, is there a way to manually update swagger-ui-dist package? It's a very old version and so many bugs are fixed in the last versions.
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?
Any plans for adding support for Adonis V5?
Currently the route GET /swagger.json
is hardcoded. https://github.com/ahmadarif/adonis-swagger/blob/master/providers/SwaggerProvider.js#L16
It would be very helpful (and necessary in my current project) to be able to change that route of the config file.
hi, @ahmadarif ,
thanks for the great work,
I want to figure out does adonis-swagger support OAS 3.0 and how?
The latest version not found command export-docs.
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?
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 :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.