OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
20.51k stars 6.27k forks source link

Enhancement: Set isFreeFormObject property #1315

Open wheezil opened 5 years ago

wheezil commented 5 years ago
Description

A free-form object field in a model can be hard to distinguish from other types in the mustache template. Making this an explicit property would be helpful

openapi-generator version

3.3.1

OpenAPI declaration file content or url
    "object_field": { 
        "type":"object"
    }
Command line used for generation

This does not seem to be specific to any generator, although different generators deal with "object" differently -- some consider it to be a primitive type and others do not.

Steps to reproduce

Process any OpenAPI definition file with model containing a field like above.

Related issues/PRs

none

Suggest a fix/enhancement

For free-form object fields, set an isFreeFormObject property to true. Add this property field to CodegenParameter and CodegenProperty, as a peer to isString, isPrimitiveType, etc. I am not yet clear what logic should be used to set this field.

ahmednfwela commented 1 week ago

@wing328 shouldn't this be closed as it was merged in #1338 ?