Open samuelallan72 opened 4 years ago
Probably a duplicate of https://github.com/OpenAPITools/openapi-generator/issues/5279
@swalladge would you be willing to make a PR with the proposed change (making this mapping a default behavior)?
@amakhrov Sorry, I won't have time to work on this.
Bug Report Checklist
Description
Given a property that is labeled as
type: object
in the openapi spec, and no extra restrictions, the typescript generator produces a parameter with type signatureobject
. In the openapi spec,object
with no extra restrictions/parameters, or withadditionalProperties: true
set, denotes any valid object with any extra properties. This should be declared in typescript as theany
type.This is an issue because now it's impossible to reference a key from the
object
type in typescript. For example, this used to be (and should be) valid:profile.name.first_name
given the schema below. Now, tsc raises an error becausefirst_name
isn't a property of anobject
.openapi-generator version
4.2.3
Previous versions set type to
any
. Not sure which versions; 4.0.0-beta3 is known to have worked.OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix
Set type to
any
for typescript values set from an openapi specobject
field.