Skip to content

Commit

Permalink
Add getOpenAPI3 to OpenAPI3 emitter (#2950)
Browse files Browse the repository at this point in the history
This function is useful when you want to work with the OpenAPI 3
directly, or don't want to write it to disk for some reason.

---------

Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>
  • Loading branch information
bterlson and timotheeguerin committed Feb 26, 2024
1 parent e9b17b3 commit aa6e53f
Show file tree
Hide file tree
Showing 7 changed files with 347 additions and 88 deletions.
7 changes: 7 additions & 0 deletions .chronus/changes/openapi3-function-2024-1-23-14-2-48.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: feature
packages:
- "@typespec/openapi3"
---

Add `getOpenAPI3` function that takes a TypeSpec program and returns the emitted OpenAPI as an object. Useful for other emitters and tools that want to work with emitted OpenAPI directly without writing it to disk.
7 changes: 7 additions & 0 deletions .chronus/changes/openapi3-function-2024-1-26-14-26-10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: feature
packages:
- "@typespec/versioning"
---

Export the VersionProjections interface.
2 changes: 1 addition & 1 deletion packages/openapi3/src/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,6 @@ export const libDef = {
} as const;

export const $lib = createTypeSpecLibrary(libDef);
export const { reportDiagnostic, createStateSymbol } = $lib;
export const { createDiagnostic, reportDiagnostic, createStateSymbol } = $lib;

export type OpenAPILibrary = typeof $lib;
Loading

0 comments on commit aa6e53f

Please sign in to comment.