Skip to content

Commit 3978705

Browse files
committed
readme
1 parent affadcb commit 3978705

File tree

1 file changed

+11
-51
lines changed

1 file changed

+11
-51
lines changed

packages/schema-api/README.md

Lines changed: 11 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# schema-typescript
1+
# schema-sdk
22

33
<p align="center" width="100%">
4-
<a href="https://github.com/pyramation/schema-typescript/actions/workflows/run-tests.yaml">
5-
<img height="20" src="https://github.com/pyramation/schema-typescript/actions/workflows/run-tests.yaml/badge.svg" />
4+
<a href="https://github.com/pyramation/schema-sdk/actions/workflows/run-tests.yaml">
5+
<img height="20" src="https://github.com/pyramation/schema-sdk/actions/workflows/run-tests.yaml/badge.svg" />
66
</a>
7-
<a href="https://github.com/pyramation/schema-typescript/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
7+
<a href="https://github.com/pyramation/schema-sdk/blob/main/LICENSE-MIT"><img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/></a>
88
</p>
99

10-
Welcome to _schema-typescript_! This project provides robust tools for handling JSON schemas and converting them to TypeScript interfaces with ease and efficiency.
10+
Welcome to _schema-sdk_! This project provides robust tools for handling OpenAPI schemas and converting them to TypeScript clients with ease and efficiency.
1111

1212
## Features
1313

@@ -21,63 +21,23 @@ Welcome to _schema-typescript_! This project provides robust tools for handling
2121

2222
## Getting Started 🏁
2323

24-
To get started with _schema-typescript_, simply run:
24+
To get started with _schema-sdk_, simply run:
2525

2626
```bash
27-
npm install schema-typescript
27+
npm install schema-sdk
2828
```
2929

30-
## Usage 📘
31-
32-
Here's a quick example to show you how to convert a JSON schema into TypeScript interfaces:
33-
34-
```javascript
35-
import { generateTypeScript } from 'schema-typescript';
36-
37-
const schema = {
38-
"$id": "https://example.com/person.schema.json",
39-
"$schema": "https://json-schema.org/draft-07/schema#",
40-
"title": "Person",
41-
"type": "object",
42-
"properties": {
43-
"firstName": { "type": "string" },
44-
"pets": {
45-
"type": "array",
46-
"items": { "$ref": "#/$defs/pet" }
47-
}
48-
},
49-
"required": ["firstName", "pets"],
50-
"$defs": {
51-
"pet": {
52-
"type": "object",
53-
"properties": {
54-
"name": { "type": "string" },
55-
"type": { "type": "string" }
56-
},
57-
"required": ["name", "type"]
58-
}
59-
}
60-
};
61-
62-
console.log(generateTypeScript(schema));
63-
// OUTPUT:
64-
interface Pet {
65-
name: string;
66-
type: string;
67-
}
68-
interface Person {
69-
firstName: string;
70-
pets: Pet[];
71-
}
72-
```
30+
## Usage
31+
32+
(see tests)
7333

7434
## Contributing 🤝
7535

7636
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
7737

7838
## Need Help?
7939

80-
`schema-typescript` might not work perfectly for all JSON schemas yet. We value your feedback and contributions to make it better. If you encounter any issues or have suggestions for improvements, please [let us know](https://github.com/pyramation/schema-typescript/issues).
40+
`schema-sdk` might not work perfectly for all JSON schemas yet. We value your feedback and contributions to make it better. If you encounter any issues or have suggestions for improvements, please [let us know](https://github.com/pyramation/schema-sdk/issues).
8141

8242
## License 📜
8343

0 commit comments

Comments
 (0)