Comments (6)
I could do that cause I need it !
:)
from openapi-comment-parser.
two proposals.
First of all a simple part of component declaration in yml like we discuss before
/**
components:
schemas:
JWS:
properties:
header:
type: string
payload:
type: string
signature:
type: string
**/
or use the https://github.com/john-doherty/jsdoc-to-json-schema proposal
/**
* @schema.name JWS
*/
const JWS = {
/**
* @schema.title Header
* @schema.type string
* @schema.required true
*/
header: '',
/**
* @schema.title Payload
* @schema.type string
* @schema.required true
*/
payload: '',
/**
* @schema.title Signature
* @schema.type string
* @schema.required true
*/
signature: '',
}
John use the jsdoc schema
tag it's quite concise format in jsdoc and refer directly to an object creation.
The integration is more straigth forward with the second because of the JSON schema integration in openAPI format.
I could try today an implementation of the second. Tel me @bourdakos1 if you think it's a good idea in order to merge it of course ! ;)
from openapi-comment-parser.
What do you mean by inline?
from openapi-comment-parser.
I think it's for jsodc object (schema) declaration like beelow
/**
* SCHEMAS JWS
* {
* "header": ... ,
* "payload": ... ,
* "signature": ....
* }
/*
/**
* POST /auth/token
* @summary Return a valid jwt
* @bodyContent {JWS} A valid Jws with x5c cert chain
* @bodyRequired
* @description Get a valid jwt
* @response 200 - OK
* @responseContent {jwt} 200.application/json
*/
or something like that or directly in yml.
I need this too ;) It's juste for convenience to declare schemas where they are used.
from openapi-comment-parser.
Ah gotcha, I went with yaml because I don’t like dealing with whitespace in jsdoc. But it shouldn’t be too hard to add if people find it useful :)
I’d also be happy to merge any pull requests if someone wanted to take a stab at building the feature?
from openapi-comment-parser.
I really like the second example! Would be more than happy to merge that feature 😁
from openapi-comment-parser.
Related Issues (20)
- There isn't a way to upload an array of files
- Handle streams?
- param examples have no effect on UI
- response examples aren't displayed
- haven't tested nested arrays
- request body table picks a random content-type
- the try it out button doesn't work for form images
- Add pagenation
- Generate md/swagger.yaml from comments? HOT 3
- Dynamic spec definitions HOT 2
- Integrating with input validation HOT 3
- How can I show an array of objects? HOT 13
- How to use with import HOT 5
- Request samples HOT 6
- File Type Support HOT 3
- warning 'Unnecessary type declaration' from `openapi/warnings` HOT 4
- Usage with NextJS
- Support for other languages
- check that schemas have been defined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openapi-comment-parser.