Giter Site home page Giter Site logo

Comments (5)

bourdakos1 avatar bourdakos1 commented on May 13, 2024 1

jsdoc-openapi was what we originally called it. We switched to openapi-comment-parser this is the only package we actively publish.

I think the issue is that we bundle this as commonjs, but I think we also bundle an es module version. I’m honestly not too sure how to fix the bundling stuff though. This uses typescript so everything is using import syntax, so I think fixing will just be a matter of tweaking the rollup config, or maybe we don’t even need rollup πŸ€·β€β™‚οΈ

If you have any insights into this feel free to open a PR, otherwise I’ll do some research

from openapi-comment-parser.

bourdakos1 avatar bourdakos1 commented on May 13, 2024 1

@Ilchuk-Mihail we use import openapi from 'openapi-comment-parser' in our project. If it's generating a spec, but it's empty, I'm guessing that it isn't able to properly calculate the appropriate directory. Have you tried using the cwd option?

I've had issues with paths when using typescript. Setting cwd to __dirname normally fixes any issues for me:

const spec = openapi({ cwd: __dirname });

from openapi-comment-parser.

Ilchuk-Mihail avatar Ilchuk-Mihail commented on May 13, 2024 1

@bourdakos1 This option works and fixed spec generation. Thank you!

from openapi-comment-parser.

vladshcherbin avatar vladshcherbin commented on May 13, 2024

I've also tried jsdoc-openapi (seems to be also yours one) and it works there. Not sure why there are duplicated packages and what's more stable to use.

from openapi-comment-parser.

Ilchuk-Mihail avatar Ilchuk-Mihail commented on May 13, 2024

Any updates on this ?

Faced same issue:
import openapi from 'openapi-comment-parser' - generate empty spec
const openapi = require('openapi-comment-parser') - works correctly

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.