Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when generate swagger with Document object #119

Open
rpinheiroalmeida opened this issue Jun 3, 2020 · 0 comments
Open

Error when generate swagger with Document object #119

rpinheiroalmeida opened this issue Jun 3, 2020 · 0 comments

Comments

@rpinheiroalmeida
Copy link

rpinheiroalmeida commented Jun 3, 2020

When I try to generate a swagger.json file for the object bellow:

export interface Domain {
  dueDate: string;
  beneficiary: Beneficiary;
}

export interface Beneficiary {
   documnet: Document;
}

export interface Document {
    identifier: string;
    type: DOCUMENT_TYPE;
}

export enum DOCUMENT_TYPE {
    CPF = 'CPF',
    CNPJ = 'CNPJ',
}

I got the follow error:

`

swaggerGen -c ./swagger.config.json

There was a problem resolving type of 'HTMLAllCollection'.
There was a problem resolving type of 'Document'.
There was a problem resolving type of 'Beneficiary'.
There was a problem resolving type of 'Domain'.
/Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/methodGenerator.js:82
throw new Error("Error generate parameter method: '" + controllerId.text + "." + methodId.text + "' argument: " + parameterId.text + " " + e);
^

Error: Error generate parameter method: 'DomainEndpoint.create' argument: boleto Error: Only string indexers are supported. Found double.
at /Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/methodGenerator.js:82:23
at Array.map ()
at MethodGenerator.buildParameters (/Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/methodGenerator.js:73:47)
at MethodGenerator.generate (/Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/methodGenerator.js:53:30)
at /Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/controllerGenerator.js:86:58
at Array.map ()
at ControllerGenerator.buildMethodsForClass (/Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/controllerGenerator.js:86:14)
at ControllerGenerator.buildMethods (/Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/controllerGenerator.js:68:43)
at ControllerGenerator.generate (/Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/controllerGenerator.js:47:27)
at /Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/metadataGenerator.js:103:58
at Array.map ()
at MetadataGenerator.buildControllers (/Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/metadataGenerator.js:103:14)
at MetadataGenerator.generate (/Users/rpinheir/Projects/company/issuer-platform/node_modules/typescript-rest-swagger/dist/metadata/metadataGenerator.js:41:32)
`
One interesting fact is when I change the name of the Document for other another name I can get generate the swagger.

@rpinheiroalmeida rpinheiroalmeida changed the title Error Error when generate swagger with Document object Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant