Skip to content

docs: add file extension to examples #12

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

Merged
merged 1 commit into from
Mar 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## How to install?

```
```sh
npm i -D fastify-schema-to-typescript
```

Expand All @@ -11,7 +11,7 @@ npm i -D fastify-schema-to-typescript
Running `npx fastify-schema-to-typescript` will convert all `schema.json` files in `src` to `schema.ts`.
You can then import `schema.ts` directly

```
```ts
import { Handler, schema } from "./schema";

export const options = {
Expand All @@ -27,7 +27,7 @@ export const handler: Handler = async (request, reply) => {}

More options are available

```
```sh
npx fastify-schema-to-typescript -h

Usage: fastify-schema-to-typescript [options]
Expand Down Expand Up @@ -62,7 +62,7 @@ Running `npx fastify-schema-to-typescript` will convert `schema.yaml` to `schema

app.ts

```
```ts
import fastify from 'fastify';
import { healthcheck } from './api'

Expand All @@ -78,13 +78,13 @@ run();

api/index.ts

```
```ts
export * from './healthcheck';
```

api/healtheck/schema.yaml

```
```yml
headers:
type: object
properties:
Expand All @@ -108,7 +108,7 @@ params:

api/healtheck/index.ts

```
```ts
import { FastifyPluginAsync } from 'fastify';
import { RouteGeneric, schema } from './schema';

Expand Down