Forum Discussion

Stoplight's avatar
Stoplight
Community Manager
5 months ago

openapi client generation with Stoplight Docs

Originally posted by user chris to the Stoplight Community on 12/28/2023 at 14:42 ET.

Has anyone used a client generator successfully with stoplight docs? We were hopingto generate typescript-axios clients to our consumers, but have found that the request/response objects are all generated with types of any. This seems to occur on any complex types that are represented as component schema references. Example, i have a request with a reference to a body of

requestBody:
        $ref: '#/components/requestBodies/aComplexObject'

and the properties within that schema's object then all get generated with type any. If there is a stoplight recommended client generator, can also try that one for typescript. Thanks!

https://github.com/OpenAPITools/openapi-generator