fastapi-code-generator icon indicating copy to clipboard operation
fastapi-code-generator copied to clipboard

AttributeError raised with MEF-LSO-Legato generated OpenAPI

Open DarioGonzalez-Axians opened this issue 3 years ago • 0 comments

I get an AttributeError when I run fastapi-codegen with some OpenAPI files generated from MEF-LSO-Legato Billie Release. The exception is raised inside jsonschema parser library. Here is the error:

File "<...>\.venv\lib\site-packages\datamodel_code_generator\parser\jsonschema.py", line 1052, in root_id_context
    root_id: Optional[str] = root_raw.get('$id')
AttributeError: 'str' object has no attribute 'get'

I left a "frozen" version of MEF-LSO-Legato in this public repo and just changed the $ref for using repo's raw files. I'm trying to generate code from <...>/serviceApi/inventory/serviceInventoryApi.openapi.yaml file when I get the error.

DarioGonzalez-Axians avatar Nov 24 '21 11:11 DarioGonzalez-Axians