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

feat: custom generator functions in JS, test component templating #159

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

cmars
Copy link
Contributor

@cmars cmars commented Mar 7, 2022

Templating over the kin-openapi/openapi3 document object model is
generally powerful enough to enumerate types in various languages, as
the test in this PR demonstrates for Typescript.

However, it's inevitable that such templates will need language-specific
adaptation functions. Rather than try to include all those batteries in
the provided builtin template functions, this PR adds support for
generator function extension with Javascript.

Note that goja is the same embedded JS engine used by Grafana k6.

@cmars cmars requested a review from a team as a code owner March 7, 2022 19:09
Templating over the kin-openapi/openapi3 document object model is
generally powerful enough to enumerate types in various languages, as
the test in this PR demonstrates for Typescript.

However, it's inevitable that such templates will need language-specific
adaptation functions. Rather than try to include all those batteries in
the provided builtin template functions, this PR adds support for
generator function extension with Javascript.

Note that goja is the same embedded JS engine used by Grafana k6.
@cmars cmars force-pushed the feat/component-generation branch from 1daf6ff to 23897b6 Compare March 7, 2022 19:29
@cmars cmars merged commit 6b157d8 into snyk:main Mar 7, 2022
@garyposter
Copy link

😮 This is super cool!!!!!!!!!

(The test would be even cooler if it showed the integer -> number thing working 😛 )

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

Successfully merging this pull request may close these issues.

2 participants