Skip to content

Commit

Permalink
fix(package-version): ZMS-160 if given version use it, otherwise use …
Browse files Browse the repository at this point in the history
…package.json version, fallback to 1.0.0 if none (#17)
  • Loading branch information
NickOvt authored Sep 5, 2024
1 parent b338619 commit f9977d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions restifyOpenapiGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ class RestifyApiGenerate {
]
};

// get package version
docs.info.version = docs.info.version || require(path.join(this.dirname, 'package.json')).version || '1.0.0'; // use provided version first, if missing means use package.json version, otherwise default to first version 1.0.0

const mapPathToMethods = {}; // map -> {path -> {post -> {}, put -> {}, delete -> {}, get -> {}}}

for (const routePath in routes) {
Expand Down

0 comments on commit f9977d6

Please sign in to comment.