-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #476 from hey-api/docs/examples
docs: add examples
- Loading branch information
Showing
13 changed files
with
129 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@hey-api/docs": patch | ||
--- | ||
|
||
docs: add examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,35 @@ | ||
<div align="center"> | ||
<img width="150" height="150" src="https://heyapi.vercel.app/logo.png" alt="Logo"> | ||
<h1 align="center"><b>OpenAPI Typescript</b></h1> | ||
<p align="center">✨ Turn your OpenAPI specification into a beautiful TypeScript client.</p> | ||
<img width="150" height="150" src="https://heyapi.vercel.app/logo.png" alt="Logo"> | ||
<h1 align="center"><b>OpenAPI Typescript</b></h1> | ||
<p align="center">✨ Turn your OpenAPI specification into a beautiful TypeScript client.</p> | ||
</div> | ||
|
||
## GitHub Integration (coming soon) | ||
Generate TypeScript interfaces, REST clients, and JSON Schemas from OpenAPI specifications. | ||
|
||
Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.vercel.app/openapi-ts/integrations.html). | ||
[Live demo](https://stackblitz.com/edit/hey-api-example?file=openapi-ts.config.ts,src%2Fclient%2Fschemas.gen.ts,src%2Fclient%2Fservices.gen.ts,src%2Fclient%2Ftypes.gen.ts) | ||
|
||
## Migrating from OpenAPI Typescript Codegen? | ||
## Features | ||
|
||
Please read our [migration guide](https://heyapi.vercel.app/openapi-ts/migrating.html#openapi-typescript-codegen). | ||
- works with CLI, Node.js, or npx | ||
- supports OpenAPI 2.0, 3.0, and 3.1 specifications | ||
- supports both JSON and YAML input files | ||
- supports external references using [json-schema-ref-parser](https://github.com/APIDevTools/json-schema-ref-parser/) | ||
- generates TypeScript interfaces, REST clients, and JSON Schemas | ||
- Fetch API, Axios, Angular, Node.js, and XHR clients available | ||
- abortable requests through cancellable promise pattern | ||
|
||
## Documentation | ||
|
||
Please visit our [website](https://heyapi.vercel.app/) for documentation, guides, migrating, and more. | ||
|
||
## GitHub Integration (coming soon) | ||
|
||
Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.vercel.app/openapi-ts/integrations.html). | ||
|
||
## Migrating from OpenAPI Typescript Codegen? | ||
|
||
Please read our [migration guide](https://heyapi.vercel.app/openapi-ts/migrating.html#openapi-typescript-codegen). | ||
|
||
## Contributing | ||
|
||
Want to get involved? Please refer to the [contributing guide](https://heyapi.vercel.app/contributing.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import sdk from '@stackblitz/sdk'; | ||
|
||
export const embedProject = (projectId: string) => async (event: Event) => { | ||
const container = document.createElement('div'); | ||
|
||
if (event.target) { | ||
const node = event.target as HTMLElement; | ||
node.replaceWith(container); | ||
} | ||
|
||
if (projectId === 'hey-api-example') { | ||
return await sdk.embedProjectId(container, projectId, { | ||
height: 700, | ||
openFile: | ||
'openapi-ts.config.ts,src/client/schemas.gen.ts,src/client/services.gen.ts,src/client/types.gen.ts', | ||
view: 'editor', | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.