OpenAPITools / OpenAPITools/openapi-generator

[REQ][C++][Pistache] Model validation for struct models

Open
#9,538 0 comments 0 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

The parameter validation merged in PR #9251 currently only applies to class types, not the struct types.

Describe the solution you'd like

The created template can be ported to work with struct types as well, to assure their contents can be validated as well.
The main body of the validation code is in a seperate mustache file (model-validation-body.mustache) and it should be reusable with some minor changes.

Describe alternatives you've considered

We could leave this as is, though it certainly is a useful feature to have.

Additional context

See #9251

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/cpp-pistache-server/model-validation-body.mustache and review the parameter-validation changes from PR #9251. Adapt the template for struct models, then verify that generated struct model contents receive the same validation as class models.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.