Forum Discussion

Stoplight's avatar
Stoplight
Community Manager
9 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

  • Stoplight's avatar
    Stoplight
    Community Manager

    MariusSc78 [12/29/2023 - 12:05 ET]

    Hi, I am not sure if this helps, but I am playing at the moment with https://learn.microsoft.com/en-us/openapi/kiota/ to generate a .Net client SDK. Kiota is able to generate clients in TypeScript, Go, Java ... I am at the very beginning of doing this - so, I've got no experience with the tool.