metadevpro / openapi3-ts

TS Model & utils for creating and exposing OpenAPI 3.x contracts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PathItemObject.parameters property is the wrong type

nwayve opened this issue · comments

https://github.com/metadevpro/openapi3-ts/blob/master/src/model/OpenApi.ts#L58

export interface PathItemObject extends ISpecificationExtension {
    $ref?: string;
    summary?: string;
    description?: string;
    get?: OperationObject;
    put?: OperationObject;
    post?: OperationObject;
    delete?: OperationObject;
    options?: OperationObject;
    head?: OperationObject;
    patch?: OperationObject;
    trace?: OperationObject;
    servers?: ServerObject;
    parameters?: {
        [param: string]: ParameterObject;
    };
}

Should be:

export interface PathItemObject extends ISpecificationExtension {
    $ref?: string;
    summary?: string;
    description?: string;
    get?: OperationObject;
    put?: OperationObject;
    post?: OperationObject;
    delete?: OperationObject;
    options?: OperationObject;
    head?: OperationObject;
    patch?: OperationObject;
    trace?: OperationObject;
    servers?: ServerObject;
    parameters?: (ParameterObject | ReferenceObject)[];
}

As defined in the documentation.

The ParameterObject has it defined correctly.

Your are right @nwayve Good eye!
Thanks for catch it up!
Fixed and released as npm package v. 0.6.0