Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base path for sample json directory #7

Open
salman-mustafa1230 opened this issue Jul 27, 2020 · 0 comments
Open

Base path for sample json directory #7

salman-mustafa1230 opened this issue Jul 27, 2020 · 0 comments

Comments

@salman-mustafa1230
Copy link

Hey plugin is really good.

I cannot give one base path for json schema directory. It will be good to give an option in apidoc.json like
"sampleJsonSchemaPath": "./schema/"

so we don't need to repeat our self in apidoc comment section.
In index.js file after getting schema we can check for the option in apidoc.json file

CODE:

let relativePath = path.join(path.dirname(filename), values.path)
if (app.packageInfos.sampleJsonSchemaPath) {
   relativePath = app.packageInfos.sampleJsonSchemaPath + values.path
   path.join(relativePath)
}
const data = fs.readFileSync( relativePath, 'utf8').toString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant