Skip to content

requestBody parameters are missing #338

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

Closed
gr2m opened this issue Oct 20, 2020 · 1 comment · Fixed by #340
Closed

requestBody parameters are missing #338

gr2m opened this issue Oct 20, 2020 · 1 comment · Fixed by #340

Comments

@gr2m
Copy link
Contributor

gr2m commented Oct 20, 2020

For example, GitHub's example schema (tests/v3/specs/github.yaml) has lots of requestBody parameters. But the generated TypeScript types (tests/v3/expected/github.ts) do not have any of it

As suggested in my comment here: #236 (comment), I'd transform something like this

      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                homepage:
                  type: string
                private:
                  type: boolean
                  default: false
              required:
                - name

into

      requestBody: {
        "application/json": {
          name: string;
          description?: string;
          homepage?: string;
          private?: boolean;
        };
      };
@drwpow
Copy link
Contributor

drwpow commented Oct 20, 2020

Yup! That makes perfect sense to me. I think your suggestion follows this projects rough guideline of “as close as possible to the spec”

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

Successfully merging a pull request may close this issue.

2 participants