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: add $$operation$$ file template #1117

Closed

Conversation

lukas-mertens
Copy link

Description

I added $$operation$$ as a file template.

Related issue(s)

#1116

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@lukas-mertens
Copy link
Author

@jonaslagoni I see that you introduced the v3 support. Does it make any sense what I am suggesting or am I missing something?

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukas-mertens we can add it, however, I would highly suggest to use the react rendering engine instead 😄

But yea, makes sense 👍

Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the tests are failing ✌️

@@ -743,6 +744,7 @@ class Generator {
objectSchema,
parameter: convertMapToObject(this.getAllParameters(asyncapiDocument)),
everySchema: convertMapToObject(asyncapiDocument.allSchemas()),
operation: convertCollectionToObject(asyncapiDocument.allOperations()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't you use convertMapToObject like other parts?

@derberg derberg changed the title feat: added $$operation$$ file template feat: add $$operation$$ file template Mar 11, 2024
@derberg
Copy link
Member

derberg commented Mar 11, 2024

@jonaslagoni I don't think we make it clear in docs what is the file templates alternative in react, how to do it

@jonaslagoni
Copy link
Member

@derberg well no I dont think we have a "coming from Nunjucks to React guide" 🤔

@derberg
Copy link
Member

derberg commented Mar 19, 2024

@jonaslagoni yeah, to be honest I did not recall file templates are actually useful for nunjucks only 😄

we have at least comparizon from the perspective of "template for templates". So we see file templates in use in https://github.com/asyncapi/template-for-generator-templates/tree/nunjucks/template/schemas in times of nunjucks and then after conversion to react https://github.com/asyncapi/template-for-generator-templates/blob/master/template/schemas/schema.js

just to be sure, @lukas-mertens what templating engine are you using?

@lukas-mertens
Copy link
Author

@derberg Yeah, I am using the old one. I didn't see it in any documentation that a new one exists and I was building my template based on https://github.com/asyncapi/dotnet-nats-template/tree/master

I didn't know it is that outdated back then. It would be really nice to have a few reference-implementations based on the new api version and new renderer

@derberg
Copy link
Member

derberg commented Mar 25, 2024

actually https://github.com/asyncapi/dotnet-nats-template/tree/master runs on new engine, the react one

also in docs that talk about template development we reference this template example implementation -> https://github.com/asyncapi/template-for-generator-templates

is the source code of your template somewhere available?

my assumption is you use react so you do not need file templates. Have a look at examples I shared in previous comment and lemme know

@derberg
Copy link
Member

derberg commented Apr 11, 2024

@lukas-mertens hey, did you have a chance to have a look at it?

@derberg
Copy link
Member

derberg commented Apr 24, 2024

closing this PR

we should not add more features to Nunjucks.

and for React - functionality is already in place - we just need to properly document it -> #1199

@derberg derberg closed this Apr 24, 2024
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.

3 participants