OpenAPITools / OpenAPITools/openapi-generator

[REQ] [go-server] Add option to enable unknown fields

Open
#20,522 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is your feature request related to a problem? Please describe.

I want to be able to allow unknown fields. The configuration is here: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/go-server/controller-api.mustache#L596. If using any additional properties, it is not possible any more to remove this line.

Describe the solution you'd like

I would like to have an additional property for disabling disallowUnknownFields.

Describe alternatives you've considered

Manually editing the file after every generation.

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 with modules/openapi-generator/src/main/resources/go-server/controller-api.mustache at the referenced configuration line and inspect how generator properties are exposed to the template. Add the requested option so generated Go servers can allow unknown fields, then verify the generated output with the relevant go-server generation checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.