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 not generated as services with OpenAPI 3.1 Specification #1252

Open
markkkkas opened this issue Nov 8, 2024 · 2 comments
Open

Webhooks not generated as services with OpenAPI 3.1 Specification #1252

markkkkas opened this issue Nov 8, 2024 · 2 comments
Labels
bug 🔥 Something isn't working feature 🚀 New feature or request
Milestone

Comments

@markkkkas
Copy link

markkkkas commented Nov 8, 2024

Description

With OpenAPI Specification 3.1, webhooks are not generated as services, resulting in an empty file.

// services.gen.ts
// This file is auto-generated by @hey-api/openapi-ts

import { createClient, createConfig, type Options } from '@hey-api/client-axios';

export const client = createClient(createConfig());
// types.gen.ts
// This file is auto-generated by @hey-api/openapi-ts

export type Pet = {
    id: number;
    name: string;
    tag?: string;
};

Reproducible example or configuration

import { defineConfig } from '@hey-api/openapi-ts';

export default defineConfig({
    client: '@hey-api/client-axios',
    input: './webhook.yaml',
    output: './src/generated-client',
    schemas: false,
});

OpenAPI specification (optional)

openapi: 3.1.0
info:
  title: Webhook Example
  version: 1.0.0
  description: >
    Easy example of documentation with a single webhook,
    provided by OpenAPI Initiative.

webhooks:
  newPet:
    post:
      description: A new pet is born, let's come and discover it in Petstore.
      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

System information (optional)

@hey-api/client-axios: 0.2.7
@hey-api/openapi-ts": 0.53.5

@markkkkas markkkkas added the bug 🔥 Something isn't working label Nov 8, 2024
@mrlubos mrlubos added the feature 🚀 New feature or request label Nov 8, 2024
@mrlubos mrlubos added this to the Parser milestone Nov 8, 2024
@mrlubos
Copy link
Member

mrlubos commented Nov 8, 2024

Hi @markkkkas, yep, that needs to be (and will be) added https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/openApi/3.1.x/parser/index.ts#L204

@mrlubos
Copy link
Member

mrlubos commented Nov 10, 2024

@markkkkas can you provide more details about your use case? How are you using webhooks? Do you use or expect to use any of the third party plugins?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🔥 Something isn't working feature 🚀 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants