Skip to main content

JSON Object Type Support in SDKs

· One min read

We have added support for a new JSON Object type in all our SDKs.

Details

Previously, we were treating all object types as any types in the SDK. Now, a CodeGen setting enableJsonPassThroughForAny is introduced that allows types to be either Any or JsonObject.

If the schema is defined in the following form, it will be treated as Any type in the SDKs.

"schemas":{
"Any":{

}
}

Any types take following equivalent types in the SDKs.

LanguageType
JavaJsonValue
C#JsonValue
TypeScriptunknown
PHPmixed
Pythonobject
RubyObject

If the schema is defined in the following form, it will be treated as JSONObject type in the SDKs.

"schemas":{
"JsonObject":{
"type":"object"
}
}

JSON Object types take following equivalent types in the SDKs.

LanguageType
JavaJsonObject
C#JsonObject
TypeScriptRecord<string, unknown>
PHPmixed
Pythondict
RubyHash