whatsapp-http-api
whatsapp-http-api copied to clipboard
[BUG] - OpenAPI JSON File contains wrong typing
Describe the bug
The OpenAPI JSON File shows String
as type Object
. This leads to erroneous code generation when using Pydantic.
Version
{
"version": "2024.6.8",
"engine": ["WEBJS", "NOWEB", "VENOM"],
"tier": "PLUS",
"browser": "/usr/bin/google-chrome-stable"
}
To Reproduce Steps to reproduce the behavior:
- Download the OpenAPI JSON File
- Notice
#/components/schemas/SessionStartRequest/properties/name/type
(Example location, Multiple mistakes in OpenAPI JSON) isObject
- Notice how in TS it is specified as a
string
. - Generate Pydantic Models with
datamodel-codegen --input openapi.json --input-file-type openapi --output waha-model.py
. - The Typing will be wrong, as there is an inconsistency between the OpenAPI Typing and the TS Typing.
Expected behavior
I would expect the type to be String