typescript-angular: single request parameter documentation (#5308)

* Feature: Add JSDoc to request parameter interface members

* Add petstore after generation changes
This commit is contained in:
Alexander Rashed 2020-02-14 09:34:45 +01:00 committed by GitHub
parent edd7cab22a
commit 3f490ea7ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 1 deletions

View File

@ -44,7 +44,8 @@ import {
{{#allParams.0}} {{#allParams.0}}
export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams { export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}RequestParams {
{{#allParams}} {{#allParams}}
{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#isNullable}} | null{{/isNullable}}; {{#description}}/** {{description}} */
{{/description}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#isNullable}} | null{{/isNullable}};
{{/allParams}} {{/allParams}}
} }

View File

@ -25,39 +25,51 @@ import { Configuration } from '../configurat
export interface AddPetRequestParams { export interface AddPetRequestParams {
/** Pet object that needs to be added to the store */
body: Pet; body: Pet;
} }
export interface DeletePetRequestParams { export interface DeletePetRequestParams {
/** Pet id to delete */
petId: number; petId: number;
apiKey?: string; apiKey?: string;
} }
export interface FindPetsByStatusRequestParams { export interface FindPetsByStatusRequestParams {
/** Status values that need to be considered for filter */
status: Array<'available' | 'pending' | 'sold'>; status: Array<'available' | 'pending' | 'sold'>;
} }
export interface FindPetsByTagsRequestParams { export interface FindPetsByTagsRequestParams {
/** Tags to filter by */
tags: Array<string>; tags: Array<string>;
} }
export interface GetPetByIdRequestParams { export interface GetPetByIdRequestParams {
/** ID of pet to return */
petId: number; petId: number;
} }
export interface UpdatePetRequestParams { export interface UpdatePetRequestParams {
/** Pet object that needs to be added to the store */
body: Pet; body: Pet;
} }
export interface UpdatePetWithFormRequestParams { export interface UpdatePetWithFormRequestParams {
/** ID of pet that needs to be updated */
petId: number; petId: number;
/** Updated name of the pet */
name?: string; name?: string;
/** Updated status of the pet */
status?: string; status?: string;
} }
export interface UploadFileRequestParams { export interface UploadFileRequestParams {
/** ID of pet to update */
petId: number; petId: number;
/** Additional data to pass to server */
additionalMetadata?: string; additionalMetadata?: string;
/** file to upload */
file?: Blob; file?: Blob;
} }

View File

@ -24,14 +24,17 @@ import { Configuration } from '../configurat
export interface DeleteOrderRequestParams { export interface DeleteOrderRequestParams {
/** ID of the order that needs to be deleted */
orderId: string; orderId: string;
} }
export interface GetOrderByIdRequestParams { export interface GetOrderByIdRequestParams {
/** ID of pet that needs to be fetched */
orderId: number; orderId: number;
} }
export interface PlaceOrderRequestParams { export interface PlaceOrderRequestParams {
/** order placed for purchasing the pet */
body: Order; body: Order;
} }

View File

@ -24,32 +24,41 @@ import { Configuration } from '../configurat
export interface CreateUserRequestParams { export interface CreateUserRequestParams {
/** Created user object */
body: User; body: User;
} }
export interface CreateUsersWithArrayInputRequestParams { export interface CreateUsersWithArrayInputRequestParams {
/** List of user object */
body: Array<User>; body: Array<User>;
} }
export interface CreateUsersWithListInputRequestParams { export interface CreateUsersWithListInputRequestParams {
/** List of user object */
body: Array<User>; body: Array<User>;
} }
export interface DeleteUserRequestParams { export interface DeleteUserRequestParams {
/** The name that needs to be deleted */
username: string; username: string;
} }
export interface GetUserByNameRequestParams { export interface GetUserByNameRequestParams {
/** The name that needs to be fetched. Use user1 for testing. */
username: string; username: string;
} }
export interface LoginUserRequestParams { export interface LoginUserRequestParams {
/** The user name for login */
username: string; username: string;
/** The password for login in clear text */
password: string; password: string;
} }
export interface UpdateUserRequestParams { export interface UpdateUserRequestParams {
/** name that need to be deleted */
username: string; username: string;
/** Updated user object */
body: User; body: User;
} }