Giter Club home page Giter Club logo

Comments (6)

kevinccbsg avatar kevinccbsg commented on May 26, 2024 2

Hi, @juicycool92 we are not very used to TS but related to Intelisense I think it is not working because this is not a valid JSDOC comment. So IntelliSense will not recognize this.

* @typedef {anyof|oneof|object} example

I don't think we could do a lot about this error 😅 We are using JSDOC as a friendly format to easily create API Docs but OpenAPI has way more scenarios that cannot be covered with JSDOC specification (For example anyof|oneof) so we have to create structures that don't match JSDOC spec. Therefore, intelisense will not work in this case.

from express-jsdoc-swagger.

kevinccbsg avatar kevinccbsg commented on May 26, 2024

Hi @zilahir I see the problem 🤔 I don't usually work with Typescript but in this PR #154 we add an example with the way you can configure your instance for your dev scripts ts-node and your build script after you run the tsc.

The file pattern must match both js and ts file.

'./simple.{ts,js}'

I hope that helps 😄

from express-jsdoc-swagger.

kevinccbsg avatar kevinccbsg commented on May 26, 2024

I'm closing this due to inactivity after we provide a new release with a solution and example. Feel free to re-open in case the error persists or create a new issue. 😄

from express-jsdoc-swagger.

juicycool92 avatar juicycool92 commented on May 26, 2024

its working with new solution.

image
But my Webstorm IDE's Code completion or

image
VsCode IDE's intellisense are not recognize variables of typedef or allOf|anyOf|oneOf etc...

what am i missing?

below codes are my setting of express-jsdoc-swagger

export const options = {
    info: {
        version: '1.0.0',
        title: 'PROJECT_TITLE',
        license: {
            name: 'MIT',
        },
    },
    security: {
        BasicAuth: {
            type: 'http',
            scheme: 'basic',
        },
    },
    baseDir: __dirname,
    // Glob pattern to find your jsdoc files (multiple patterns can be added in an array)
    filesPattern: [  '../../**/*.{ts,js}', '../../**/*.d.ts' ], // Glob pattern to find your jsdoc files
    // URL where SwaggerUI will be rendered
    swaggerUIPath: '/api-docs',
    // Expose OpenAPI UI
    exposeSwaggerUI: true,
    // Expose Open API JSON Docs documentation in `apiDocsPath` path.
    exposeApiDocs: true,
    // Open API JSON Docs endpoint.
    apiDocsPath: '/v3/api-docs',
    // Set non-required fields as nullable by default
    notRequiredAsNullable: false,
    // You can customize your UI options.
    // you can extend swagger-ui-express config. You can checkout an example of this
    // in the `example/configuration/swaggerOptions.js`
    swaggerUiOptions: {},
};

I installed 1.6.2 version in this case :>

Thanks.

from express-jsdoc-swagger.

kevinccbsg avatar kevinccbsg commented on May 26, 2024

Hi @juicycool92, It is not going to show in your IDE as I think intellisense is expecting a JSDOC format. As you might see in our docs page, we are using a similar format but not the same format as JSDOC because OpenAPI/Swagger has more options that are not part of the JSDOC specification. Therefore, you'll see that issue in your IDE.

Your question was related to this issue I think #120

from express-jsdoc-swagger.

juicycool92 avatar juicycool92 commented on May 26, 2024

Hi @kevinccbsg .
Thanks for kind reply.

after I digging up, I realized that my project are required to add @types/swagger-ui-express for recognize allOf or express-jsdoc-swagger's own property.

seems like it just happy coincidence, but... at least it works for now.

image
but unfortunately, I did not resolve another issues that define variables in @typedef is not recognized yet.

I copied ts-example
for just in case that example is working, but seems like no luck.

its work.. but make me itching that intellisense or codecompletion working perfectly on .js, but .ts files got ton of error...

can you help me what is going on?

from express-jsdoc-swagger.

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.