swagger-typescript-api
swagger-typescript-api copied to clipboard
TypeScript API generator via Swagger scheme
## Description When generating TypeScript enums from a Swagger/OpenAPI spec with `x-enumNames` containing names that start with numbers, the generated enum keys are invalid TypeScript identifiers. ## Expected Behavior The...
**Summary** swagger-typescript-api does not correctly interpret OpenAPI 3.1 schemas that use a nullable object type expressed as a union: ``` { "type": ["null", "object"], "additionalProperties": { "type": "string" } }...
For some reasons, types are matched by content. For exemple if we have an API that only get as body an array of integers, with no type name, this type...
Recently I needed to handle a new endpoint in our API with 204 and 207 type responses. Encountered [this issue and workaround](https://github.com/acacode/swagger-typescript-api/issues/318#issuecomment-1713592903) that I implemented here
## Summary I'm trying to provide a custom enum template `enum-data-contract.ejs` in my custom templates folder, but although the generator logs that it finds the enum template in my custom...
Added processing of array of properties, for adding to formData sequentially, element by element I Have the problem my backend contract is ```csharp /// /// Новые фотографии автосервиса /// [MaxFileSize(ImageValidationConstants.MaxFileSize)]...
I prefer to use single quotes for string and enum values. So I tried to configure behaviour of generator from custom config file. ``` { Ts: { StringValue: (content) =>...
feat: - add `--sort-route-params` flags Before, the order of an API’s parameters was defined by the order specified in the Swagger definition, which could be counter‑intuitive. For example: ```js JournalArticleCreate(...
Steps to reproduce: ```js import path from 'path' import { generateApi } from 'swagger-typescript-api' generateApi({ output: path.resolve(process.cwd(), './src/lib'), fileName: 'client.js', url: 'https://some.swagger/swagger.json', toJS: true, compilerTsConfig: { declaration: false }, })...
> [!NOTE] > Enhances query serialization to handle objects and arrays using bracketed keys (key[index]/key[subkey]) in `fetch-http-client.ejs`. > > - **HTTP Client Template (`templates/base/http-clients/fetch-http-client.ejs`)**: > - **Query serialization**: > -...