Git Product home page Git Product logo

Comments (6)

aurelhann avatar aurelhann commented on June 21, 2024 1

I could do that cause I need it !

:)

from openapi-comment-parser.

aurelhann avatar aurelhann commented on June 21, 2024 1

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.

bourdakos1 avatar bourdakos1 commented on June 21, 2024

What do you mean by inline?

from openapi-comment-parser.

aurelhann avatar aurelhann commented on June 21, 2024

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.

bourdakos1 avatar bourdakos1 commented on June 21, 2024

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.

bourdakos1 avatar bourdakos1 commented on June 21, 2024

I really like the second example! Would be more than happy to merge that feature 😁

from openapi-comment-parser.

Related Issues (20)

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.