Files
dify/packages/openapi-content-mapper/examples/petstore/client.ts
T
Stephen Zhouandautofix-ci[bot] 226110d611 feat(web): set up @dify/openapi-content-mapper foundations (#44627)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-10-26 05:06:34 +00:00

12 lines
482 B
TypeScript

import { createClient } from '@dify/openapi-content-mapper'
import { api } from './pets.openapi.yaml'
export const client = createClient({ baseUrl: 'http://127.0.0.1:4317' })
// Hover, complete operation names, or deliberately introduce an invalid field here.
export async function example() {
const pet = await api.pets.byPetId.get({ params: { petId: 1 } }, { client })
const pets = await api.pets.get({ query: { status: 'available' } }, { client })
return { pet, pets }
}