You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @DataTigerGitHub,
There is no feature to automatically generate code samples right now. Adding code samples to spec steps adds samples from spec/code_samples folder in your repo.
Just add them according to the README file in this folder.
IF you use generator-openapi-repo then you just have to put your snippets into correct folders: <lang>/<path>/<HTTP verb>.<extension> where <path> is the method path.
To bundle your snippets into single spec just run: npm run build and you will get your bundled file in web_deploy/swagger.json
Activity
RomanHotsiy commentedon Aug 9, 2017
Hey @DataTigerGitHub,
There is no feature to automatically generate code samples right now.
Adding code samples to spec
steps adds samples fromspec/code_samples
folder in your repo.Just add them according to the README file in this folder.
Use sample repo for the reference.
As for
Running plugins
message, it is not related to code samples thing and it's ok.RomanHotsiy commentedon Aug 17, 2017
IF you use generator-openapi-repo then you just have to put your snippets into correct folders:
<lang>/<path>/<HTTP verb>.<extension>
where<path>
is the method path.To bundle your snippets into single spec just run:
npm run build
and you will get your bundled file inweb_deploy/swagger.json
jgabriels commentedon Mar 3, 2018
I have a fully working code generator:
https://github.com/Direct-Freight/df-api-docs/blob/master/scripts/generate-code-samples.js
It's called during the build:
https://github.com/Direct-Freight/df-api-docs/blob/master/scripts/build.js
You can see what the final results looks like here:
http://apidocs.directfreight.com/#tag/boards
I created a pull request here: #18
but haven't tested it on any third party definitions.