Skip to content

[BUG] Core java schema classes missing schema required property names + requiredVars values #8906

@spacether

Description

@spacether

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Core classes that store schemas:

  • CodegenModel
  • CodegenProperty
  • CodegenParameter
  • CodegenResponse

are missing schema.required information which is a list of strings
At first glance it looks like requiredVars may contain this info but that's not true
That only stores properties whose names are in required.
So if a property is an additionalProperty (not defined in properties) then it does not make it into requiredVars
@wing328
@jimschubert
@cbornet
@ackintosh
@jmini
@etherealjoy
@sebastien-rosset

Feature: jsonschema.required

openapi-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

Add requiredPropertyNames to:

  • CodegenModel
  • CodegenProperty
  • CodegenParameter
  • CodegenResponse

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions