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

Incorrect Output for Referencing Schemas from Other Schemas #319

Closed
sps-software opened this issue Sep 6, 2020 · 1 comment
Closed

Incorrect Output for Referencing Schemas from Other Schemas #319

sps-software opened this issue Sep 6, 2020 · 1 comment

Comments

@sps-software
Copy link

When referencing schemas from other schema values, which I believe is allowed from what I've seen, the referenced schema is generated to { [key: string]: any } in the corresponding Typescript.

Here's an example swaggerfile:

  "components": {
     "schemas": {
         "userEmail": {
            "type": "string",
            "format": "email",
            "example": "hello@world.com"
         },
         "CancelationStatus": {
            "type": "object",
            "required": [
               "userUUID",
               "userEmail",
               "dateTime",
               "status"
            ],
            "properties": {
               "userEmail": {
                  "schema": {
                     "$ref": "#/components/schemas/userEmail"
                  }
               },
               "status": {
                  "type": "string",
                  "enum": [
                     "Initiated",
                     "Complete",
                     "Error"
                  ],
                  "example": "Initiated."
               }
            }
         }
     }
  }

And the output TS:

schemas: {
    userEmail: string;
    CancelationStatus: {
      userEmail: { [key: string]: any };
      userUUID: { [key: string]: any };
      dateTime: { [key: string]: any };
      status: "Initiated" | "Complete" | "Error";
    };
}
@sps-software
Copy link
Author

Whoops, my mistake. The schema was incorrect.

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