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
When I update the licenseInfo.mustache template to reference vendor extensions and nest it in other templates, it works fine in files such as api.mustache, api_test.mustache, and apiServiceImpl.mustache. It does not output the value in model.mustache or pojo.mustache. Referencing included template variables (such as infoName) works fine.
Swagger-codegen version
swagger-codegen-cli-3.0.24 (cannot use latest at the moment due to Java version)
Swagger declaration file content or url
Unfortunately I cannot paste all of the code in here, but I can at least show how things are referenced/declared:
Folder structure:
swagger
/gen
/codegen
swagger-codegen-cli-3.0.24.jar
/templates
/jaxrs-cxf
<contents of JavaJaxRS folder from JAR file>
/output
/api
openapi: 3.0.1x-year: 2025info:
name: Your Namepaths:
Declaration in licenseInfo.mustache:
{{vendorExtensions.x-year}}
Use of licenseInfo.mustache in model.mustache and api.mustache
Using any yaml file with a defined model, add the x-year property at the root level. Also, to show that included variables work fine, ensure to include info -> name in the yaml.
Update the licenseInfo template directly under jaxrs-cxf folder to the above reference, using the template variable (name) and the vendor extension (x-year).
Import licenseInfo to model.mustache and api.mustache per the above reference.
cd into the swagger folder and run the JAR from there.
When you open the API file(s), you will see that the licenseInfo text is there, with the year and name.
When you open the model file, you will notice that the licenseInfo text is there, with the name, but minus the year. So, I think the import is working, but perhaps there's a vendor extension scoping issue somewhere?
Related issues/PRs
I didn't find anything similar.
Suggest a fix/enhancement
Fix the issue.
The text was updated successfully, but these errors were encountered:
Description
When I update the licenseInfo.mustache template to reference vendor extensions and nest it in other templates, it works fine in files such as api.mustache, api_test.mustache, and apiServiceImpl.mustache. It does not output the value in model.mustache or pojo.mustache. Referencing included template variables (such as infoName) works fine.
Swagger-codegen version
swagger-codegen-cli-3.0.24 (cannot use latest at the moment due to Java version)
Swagger declaration file content or url
Unfortunately I cannot paste all of the code in here, but I can at least show how things are referenced/declared:
Folder structure:
Declaration in licenseInfo.mustache:
{{vendorExtensions.x-year}}
Use of licenseInfo.mustache in model.mustache and api.mustache
{{>licenseInfo}}
config-api.json
Command line used for generation
Steps to reproduce
Related issues/PRs
I didn't find anything similar.
Suggest a fix/enhancement
Fix the issue.
The text was updated successfully, but these errors were encountered: