whatsapp-http-api icon indicating copy to clipboard operation
whatsapp-http-api copied to clipboard

[BUG] - OpenAPI JSON File contains wrong typing

Open IQisMySenpai opened this issue 7 months ago • 1 comments

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:

  1. Download the OpenAPI JSON File
  2. Notice #/components/schemas/SessionStartRequest/properties/name/type (Example location, Multiple mistakes in OpenAPI JSON) is Object
  3. Notice how in TS it is specified as a string.
  4. Generate Pydantic Models with datamodel-codegen --input openapi.json --input-file-type openapi --output waha-model.py.
  5. 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

IQisMySenpai avatar Jul 01 '24 16:07 IQisMySenpai