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

Feat/swagger infer #678

Merged
merged 4 commits into from
Nov 26, 2023
Merged

Feat/swagger infer #678

merged 4 commits into from
Nov 26, 2023

Conversation

stijnvanhulle
Copy link
Collaborator

@stijnvanhulle stijnvanhulle commented Nov 25, 2023

import { Infer } from "@kubb/swagger"
// or import { Parse, Model } from "@kubb/swagger/infer"

const oas = {
  'openapi': '3.0.3',
  //....
} as const

type Oas = Infer.Parse<typeof oas>
type Paths = keyof Infer.PathMap<Oas>
type Methods = keyof Infer.MethodMap<Oas, '/pet'>

type UserModel = Infer.Model<Oas, 'User'>
type UserRequestParams = Infer.RequestParams<Oas, '/pet', 'post'>
type UserResponse = Infer.Response<Oas, '/pet', 'post', '200'>

Copy link

changeset-bot bot commented Nov 25, 2023

🦋 Changeset detected

Latest commit: 7a9b55b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@kubb/swagger Major
@kubb/swagger-client Major
@kubb/types Major
@kubb/core Major
@kubb/cli Major
@kubb/parser Major
@kubb/react Major
@kubb/swagger-faker Major
@kubb/swagger-msw Major
@kubb/swagger-swr Major
@kubb/swagger-tanstack-query Major
@kubb/swagger-ts Major
@kubb/swagger-zod Major
@kubb/swagger-zodios Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kubb ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 26, 2023 0:42am

Copy link

codesandbox-ci bot commented Nov 25, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7a9b55b:

Sandbox Source
advanced-pet-store Configuration
faker-pet-store Configuration
msw-pet-store Configuration
msw-v2-pet-store Configuration
react-query-pet-store Configuration
react-query-v5-pet-store Configuration
typescript-pet-store Configuration
simple-single-pet-store Configuration
solid-query-pet-store Configuration
svelte-query-pet-store Configuration
swr-pet-store Configuration
vue-query-pet-store Configuration
vue-query-v5-pet-store Configuration
zod-pet-store Configuration
zodios-pet-store Configuration
client-pet-store Configuration

Copy link

codecov bot commented Nov 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e9f4400) 85.65% compared to head (7a9b55b) 85.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##             beta     #678      +/-   ##
==========================================
+ Coverage   85.65%   85.66%   +0.01%     
==========================================
  Files         111      112       +1     
  Lines        8211     8219       +8     
  Branches      994      994              
==========================================
+ Hits         7033     7041       +8     
  Misses       1177     1177              
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stijnvanhulle stijnvanhulle merged commit 48b7ff2 into beta Nov 26, 2023
8 checks passed
@stijnvanhulle stijnvanhulle deleted the feat/swaggerInfer branch November 26, 2023 10:43
@stijnvanhulle stijnvanhulle mentioned this pull request Nov 26, 2023
@github-actions github-actions bot mentioned this pull request Dec 8, 2023
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 this pull request may close these issues.

1 participant