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

Fix warnings during generation #133

Merged
merged 1 commit into from
Jun 9, 2023
Merged

Fix warnings during generation #133

merged 1 commit into from
Jun 9, 2023

Conversation

maxb
Copy link
Contributor

@maxb maxb commented Jun 7, 2023

This is the vault-client-dotnet counterpart to
hashicorp/vault-client-go#178.

Currently, if you run make generate | grep 'Unregistered helper name'
there are 16260 warnings due to endpoints missing various fields in their data models:

    192 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'collectionFormat', processing template:
     54 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'complexType', processing template:
   3369 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'description', processing template:
    942 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'mediaType', processing template:
   1600 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'notes', processing template:
   7271 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'returnType', processing template:
   2832 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'summary', processing template:

The overwhelming number of warnings makes it harder to spot genuine
issues occurring.

This change wraps each unconditional reference to these fields in an
{{#if}} or {{#with}} to cure the warnings.

How has this been tested?

Generation with the updated templates produces no changes to the output files.

This is the vault-client-dotnet counterpart to
hashicorp/vault-client-go#178.

Currently, if you run `make generate | grep 'Unregistered helper name'`
there are 16260 warnings due to endpoints missing various fields in their data models:
```
    192 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'collectionFormat', processing template:
     54 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'complexType', processing template:
   3369 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'description', processing template:
    942 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'mediaType', processing template:
   1600 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'notes', processing template:
   7271 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'returnType', processing template:
   2832 [main] WARN  o.o.c.t.HandlebarsEngineAdapter - Unregistered helper name 'summary', processing template:
```

The overwhelming number of warnings makes it harder to spot genuine
issues occurring.

This change wraps each unconditional reference to these fields in an
`{{#if}}` or `{{#with}}` to cure the warnings.
@maxb maxb requested a review from a team June 7, 2023 17:53
Copy link
Contributor

@dhuckins dhuckins left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@AnPucel can you take a look?

Copy link
Collaborator

@averche averche left a comment

Choose a reason for hiding this comment

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

Thanks for fixing these, @maxb!

Copy link
Contributor

@AnPucel AnPucel left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks so much for this!

@dhuckins dhuckins merged commit 6589cb9 into hashicorp:main Jun 9, 2023
@maxb maxb deleted the fix-generation-warnings branch June 9, 2023 21:50
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.

4 participants