Updated main branch name

This commit is contained in:
Ferdi Koomen 2024-04-05 15:56:10 +02:00
parent ccdc9d3ead
commit 1e04c979e1
54 changed files with 57 additions and 57 deletions

View File

@ -2,9 +2,9 @@ name: "CodeQL"
on:
push:
branches: [ "master" ]
branches: [ "main" ]
pull_request:
branches: [ "master" ]
branches: [ "main" ]
schedule:
- cron: "44 20 * * 3"

View File

@ -20,7 +20,7 @@ https://help.github.com/articles/using-pull-requests
## Submitting a Pull Request
1. Make your changes in a new git branch: `git checkout -b my-fix-branch master`
1. Make your changes in a new git branch: `git checkout -b my-fix-branch main`
2. Create your patch or feature
3. Ensure the builds work by running: `npm run build`
4. Ensure the tests will pass by running: `npm run test`

View File

@ -79,5 +79,5 @@ If you're from an enterprise looking for a fully managed SDK generation, please
[coverage-image]: https://img.shields.io/codecov/c/github/ferdikoomen/openapi-typescript-codegen.svg
[downloads-url]: http://npm-stat.com/charts.html?package=openapi-typescript-codegen
[downloads-image]: http://img.shields.io/npm/dm/openapi-typescript-codegen.svg
[build-url]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/master
[build-image]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/master.svg?style=svg
[build-url]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/main
[build-image]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/main.svg?style=svg

View File

@ -2,7 +2,7 @@
"openapi": "3.0.2",
"info": {
"title": "Swagger Petstore - OpenAPI 3.0",
"description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml) ",
"description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/main/src/main/resources/openapi.yaml) ",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "apiteam@swagger.io"

View File

@ -19,7 +19,7 @@ describe('index', () => {
it('downloads and parses v2 without issues', async () => {
await OpenAPI.generate({
input: 'https://raw.githubusercontent.com/ferdikoomen/openapi-typescript-codegen/master/test/spec/v2.json',
input: 'https://raw.githubusercontent.com/ferdikoomen/openapi-typescript-codegen/main/test/spec/v2.json',
output: './generated/v2-downloaded/',
write: false,
});
@ -27,7 +27,7 @@ describe('index', () => {
it('downloads and parses v3 without issues', async () => {
await OpenAPI.generate({
input: 'https://raw.githubusercontent.com/ferdikoomen/openapi-typescript-codegen/master/test/spec/v3.json',
input: 'https://raw.githubusercontent.com/ferdikoomen/openapi-typescript-codegen/main/test/spec/v3.json',
output: './generated/v3-downloaded/',
write: false,
});

View File

@ -10,7 +10,7 @@ import type { OpenApiSecurityScheme } from './OpenApiSecurityScheme';
import type { OpenApiTag } from './OpenApiTag';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md
*/
export interface OpenApi {
swagger: string;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#contactObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#contactObject
*/
export interface OpenApiContact {
name?: string;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#exampleObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#exampleObject
*/
export interface OpenApiExample {
[mimetype: string]: any;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#externalDocumentationObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#externalDocumentationObject
*/
export interface OpenApiExternalDocs {
description?: string;

View File

@ -2,7 +2,7 @@ import type { Dictionary } from '../../../utils/types';
import type { OpenApiItems } from './OpenApiItems';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#headerObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#headerObject
*/
export interface OpenApiHeader {
description?: string;

View File

@ -2,7 +2,7 @@ import type { OpenApiContact } from './OpenApiContact';
import type { OpenApiLicense } from './OpenApiLicense';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#infoObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#infoObject
*/
export interface OpenApiInfo {
title: string;

View File

@ -1,7 +1,7 @@
import type { WithEnumExtension } from './Extensions/WithEnumExtension';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#itemsObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#itemsObject
*/
export interface OpenApiItems extends WithEnumExtension {
type?: string;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#licenseObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#licenseObject
*/
export interface OpenApiLicense {
name: string;

View File

@ -4,7 +4,7 @@ import type { OpenApiResponses } from './OpenApiResponses';
import type { OpenApiSecurityRequirement } from './OpenApiSecurityRequirement';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#operationObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#operationObject
*/
export interface OpenApiOperation {
tags?: string[];

View File

@ -5,7 +5,7 @@ import type { OpenApiReference } from './OpenApiReference';
import type { OpenApiSchema } from './OpenApiSchema';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#parameterObject
*/
export interface OpenApiParameter extends OpenApiReference, WithEnumExtension, WithNullableExtension {
name: string;

View File

@ -3,7 +3,7 @@ import type { OpenApiParameter } from './OpenApiParameter';
import type { OpenApiReference } from './OpenApiReference';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#pathItemObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#pathItemObject
*/
export interface OpenApiPath extends OpenApiReference {
get?: OpenApiOperation;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#referenceObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#referenceObject
*/
export interface OpenApiReference {
$ref?: string;

View File

@ -5,7 +5,7 @@ import type { OpenApiReference } from './OpenApiReference';
import type { OpenApiSchema } from './OpenApiSchema';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#responseObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#responseObject
*/
export interface OpenApiResponse extends OpenApiReference {
description: string;

View File

@ -1,7 +1,7 @@
import type { OpenApiResponse } from './OpenApiResponse';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#responsesObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#responsesObject
*/
export interface OpenApiResponses {
default?: OpenApiResponse;

View File

@ -6,7 +6,7 @@ import type { OpenApiReference } from './OpenApiReference';
import type { OpenApiXml } from './OpenApiXml';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#schemaObject
*/
export interface OpenApiSchema extends OpenApiReference, WithEnumExtension, WithNullableExtension {
title?: string;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#securityRequirementObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#securityRequirementObject
*/
export interface OpenApiSecurityRequirement {
[key: string]: string;

View File

@ -1,7 +1,7 @@
import type { Dictionary } from '../../../utils/types';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#securitySchemeObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#securitySchemeObject
*/
export interface OpenApiSecurityScheme {
type: 'basic' | 'apiKey' | 'oauth2';

View File

@ -1,7 +1,7 @@
import type { OpenApiExternalDocs } from './OpenApiExternalDocs';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#tagObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#tagObject
*/
export interface OpenApiTag {
name: string;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#xmlObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#xmlObject
*/
export interface OpenApiXml {
name?: string;

View File

@ -7,7 +7,7 @@ import type { OpenApiServer } from './OpenApiServer';
import type { OpenApiTag } from './OpenApiTag';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md
*/
export interface OpenApi {
openapi: string;

View File

@ -2,7 +2,7 @@ import type { OpenApiPath } from './OpenApiPath';
import type { OpenApiReference } from './OpenApiReference';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#callbackObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#callbackObject
*/
export interface OpenApiCallback extends OpenApiReference {
[key: string]: OpenApiPath;

View File

@ -10,7 +10,7 @@ import type { OpenApiSchema } from './OpenApiSchema';
import type { OpenApiSecurityScheme } from './OpenApiSecurityScheme';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#componentsObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#componentsObject
*/
export interface OpenApiComponents {
schemas?: Dictionary<OpenApiSchema>;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#contactObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#contactObject
*/
export interface OpenApiContact {
name?: string;

View File

@ -1,7 +1,7 @@
import type { Dictionary } from '../../../utils/types';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#discriminatorObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#discriminatorObject
*/
export interface OpenApiDiscriminator {
propertyName: string;

View File

@ -2,7 +2,7 @@ import type { Dictionary } from '../../../utils/types';
import type { OpenApiHeader } from './OpenApiHeader';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#encodingObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#encodingObject
*/
export interface OpenApiEncoding {
contentType?: string;

View File

@ -1,7 +1,7 @@
import type { OpenApiReference } from './OpenApiReference';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#exampleObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#exampleObject
*/
export interface OpenApiExample extends OpenApiReference {
summary?: string;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#externalDocumentationObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#externalDocumentationObject
*/
export interface OpenApiExternalDocs {
description?: string;

View File

@ -4,7 +4,7 @@ import type { OpenApiReference } from './OpenApiReference';
import type { OpenApiSchema } from './OpenApiSchema';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#headerObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#headerObject
*/
export interface OpenApiHeader extends OpenApiReference {
description?: string;

View File

@ -2,7 +2,7 @@ import type { OpenApiContact } from './OpenApiContact';
import type { OpenApiLicense } from './OpenApiLicense';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#infoObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#infoObject
*/
export interface OpenApiInfo {
title: string;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#licenseObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#licenseObject
*/
export interface OpenApiLicense {
name: string;

View File

@ -3,7 +3,7 @@ import type { OpenApiReference } from './OpenApiReference';
import type { OpenApiServer } from './OpenApiServer';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#linkObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#linkObject
*/
export interface OpenApiLink extends OpenApiReference {
operationRef?: string;

View File

@ -5,7 +5,7 @@ import type { OpenApiReference } from './OpenApiReference';
import type { OpenApiSchema } from './OpenApiSchema';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#mediaTypeObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#mediaTypeObject
*/
export interface OpenApiMediaType extends OpenApiReference {
schema?: OpenApiSchema;

View File

@ -1,7 +1,7 @@
import type { Dictionary } from '../../../utils/types';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#oauthFlowObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#oauthFlowObject
*/
export interface OpenApiOAuthFlow {
authorizationUrl: string;

View File

@ -1,7 +1,7 @@
import type { OpenApiOAuthFlow } from './OpenApiOAuthFlow';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#oauthFlowsObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#oauthFlowsObject
*/
export interface OpenApiOAuthFlows {
implicit?: OpenApiOAuthFlow;

View File

@ -8,7 +8,7 @@ import type { OpenApiSecurityRequirement } from './OpenApiSecurityRequirement';
import type { OpenApiServer } from './OpenApiServer';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#operationObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#operationObject
*/
export interface OpenApiOperation {
tags?: string[];

View File

@ -4,7 +4,7 @@ import type { OpenApiReference } from './OpenApiReference';
import type { OpenApiSchema } from './OpenApiSchema';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#parameterObject
*/
export interface OpenApiParameter extends OpenApiReference {
name: string;

View File

@ -3,7 +3,7 @@ import type { OpenApiParameter } from './OpenApiParameter';
import type { OpenApiServer } from './OpenApiServer';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathItemObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#pathItemObject
*/
export interface OpenApiPath {
summary?: string;

View File

@ -1,7 +1,7 @@
import type { OpenApiPath } from './OpenApiPath';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#pathsObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#pathsObject
*/
export interface OpenApiPaths {
[path: string]: OpenApiPath;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#referenceObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#referenceObject
*/
export interface OpenApiReference {
$ref?: string;

View File

@ -3,7 +3,7 @@ import type { OpenApiMediaType } from './OpenApiMediaType';
import type { OpenApiReference } from './OpenApiReference';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#requestBodyObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#requestBodyObject
*/
export interface OpenApiRequestBody extends OpenApiReference {
description?: string;

View File

@ -5,7 +5,7 @@ import type { OpenApiMediaType } from './OpenApiMediaType';
import type { OpenApiReference } from './OpenApiReference';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#responseObject
*/
export interface OpenApiResponse extends OpenApiReference {
description: string;

View File

@ -2,7 +2,7 @@ import type { OpenApiReference } from './OpenApiReference';
import type { OpenApiResponse } from './OpenApiResponse';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responsesObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#responsesObject
*/
export interface OpenApiResponses extends OpenApiReference {
default: OpenApiResponse;

View File

@ -6,7 +6,7 @@ import type { OpenApiReference } from './OpenApiReference';
import type { OpenApiXml } from './OpenApiXml';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject
*/
export interface OpenApiSchema extends OpenApiReference, WithEnumExtension {
title?: string;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#securityRequirementObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#securityRequirementObject
*/
export interface OpenApiSecurityRequirement {
[name: string]: string;

View File

@ -2,7 +2,7 @@ import type { OpenApiOAuthFlows } from './OpenApiOAuthFlows';
import type { OpenApiReference } from './OpenApiReference';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#securitySchemeObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#securitySchemeObject
*/
export interface OpenApiSecurityScheme extends OpenApiReference {
type: 'apiKey' | 'http' | 'oauth2' | 'openIdConnect';

View File

@ -2,7 +2,7 @@ import type { Dictionary } from '../../../utils/types';
import type { OpenApiServerVariable } from './OpenApiServerVariable';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#serverObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#serverObject
*/
export interface OpenApiServer {
url: string;

View File

@ -1,7 +1,7 @@
import type { WithEnumExtension } from './Extensions/WithEnumExtension';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#serverVariableObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#serverVariableObject
*/
export interface OpenApiServerVariable extends WithEnumExtension {
enum?: (string | number)[];

View File

@ -1,7 +1,7 @@
import type { OpenApiExternalDocs } from './OpenApiExternalDocs';
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#tagObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#tagObject
*/
export interface OpenApiTag {
name: string;

View File

@ -1,5 +1,5 @@
/**
* https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#xmlObject
* https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#xmlObject
*/
export interface OpenApiXml {
name?: string;