OpenAPITools / OpenAPITools/openapi-generator

HandlebarsEngineAdapter outputs warning on property reference

Open
#7,881 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

https://github.com/OpenAPITools/openapi-generator/blob/b3bc926b1d48840903a1293b0c74c49e9391966c/modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java#L77

When using the HandlebarsEngineAdapter, expressions such as {{description}} in a template file gives the warning message "[WARNING] Unregistered helper name 'with', processing template:". Here is an example of the error message

    /**
     * {{{description}}}
     */
[WARNING] Unregistered helper name 'with', processing template:

I'm not familiar enough with the jknack Handlebars implementation to know whether this is a real issue or not. But if my understanding is correct, the callback registered with registerHelperMissing should probably not log if options.helperName.equals("with").

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at modules/openapi-generator/src/main/java/org/openapitools/codegen/templating/HandlebarsEngineAdapter.java#L77 and reproduce the warning with a template containing {{description}} or {{{description}}}. Inspect the registerHelperMissing callback and confirm the fix by verifying property references render without the unregistered-helper warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
handlebars, java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.