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

Webhooks are not being generated #994

Closed
1 of 2 tasks
wolfy1339 opened this issue Nov 15, 2022 · 2 comments · Fixed by #1001
Closed
1 of 2 tasks

Webhooks are not being generated #994

wolfy1339 opened this issue Nov 15, 2022 · 2 comments · Fixed by #1001
Labels
bug Something isn't working good first issue Straightforward problem, solvable for first-time contributors without deep knowledge of the project PRs welcome PRs are welcome to solve this issue!

Comments

@wolfy1339
Copy link

Description

_A brief description of the issue. _

The webhooks object in the OpenAPI schema is not being generated in the outputted types

OpenAPI 3.1, https://spec.openapis.org/oas/latest.html#oasWebhooks

OpenAPI
GitHub Next OpenAPI schema

openapi: 3.1.0
info:
  title: Webhook Example
  version: 1.0.0
webhooks:
  newPet:
    post:
      requestBody:
        description: Information about a new pet in the system
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Pet"
      responses:
        "200":
          description: Return a 200 status to indicate that the data was received successfully

components:
  schemas:
    Pet:
      required:
        - id
        - name
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        tag:
          type: string

Generated TS

// What’s generated in the current version (or put “nothing” if it’s skipped)

*Expected TS

// What you’d like to see generated
export interface webhooks {
  "newPet": {
    "post": 
      requestBody: {
        content: {
          "application/json": components['schemas']['Pets'];
        }
      }
  }
}

Checklist

  • My OpenAPI schema passes a validator
  • I’m willing to open a PR for this (see CONTRIBUTING.md)
@wolfy1339 wolfy1339 added the bug Something isn't working label Nov 15, 2022
@drwpow drwpow added PRs welcome PRs are welcome to solve this issue! good first issue Straightforward problem, solvable for first-time contributors without deep knowledge of the project labels Nov 16, 2022
@drwpow
Copy link
Contributor

drwpow commented Nov 16, 2022

I don’t think this library has ever generated webhooks, so I don’t know if it’s a “bug” but this could be added fairly easily. Would love a PR on this! (it should be fairly straightforward to add)

@yacinehmito
Copy link
Contributor

I'd like to implement this.

yacinehmito added a commit to yacinehmito/openapi-typescript that referenced this issue Nov 20, 2022
@yacinehmito yacinehmito mentioned this issue Nov 20, 2022
3 tasks
drwpow pushed a commit that referenced this issue Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Straightforward problem, solvable for first-time contributors without deep knowledge of the project PRs welcome PRs are welcome to solve this issue!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants