Skip to content

Commit 479b0c6

Browse files
authored
chore: update docs (#275)
1 parent 1fca088 commit 479b0c6

File tree

5 files changed

+13
-60
lines changed

5 files changed

+13
-60
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@
4646
</table>
4747

4848
# Core Features
49-
- 📃 Generate [payload](https://the-codegen-project.org/docs/generators/payloads), [headers](https://the-codegen-project.org/docs/generators/headers) or [parameter](https://the-codegen-project.org/docs/generators/parameters) representations from your AsyncAPI document (including Protobuf, RAML, OpenAPI Schema) or OpenAPI (Swagger 2.0, 3.0, and 3.1)
50-
- 📊 Customize the output to your hearts desire
51-
- 💫 Regenerate once the input changes
52-
- 👀 Integrate it into any project (such as [Next.JS](./examples/typescript-nextjs), [TypeScript Libraries](./examples/typescript-library), you name it.)
49+
- 📃 Generate [payloads](https://the-codegen-project.org/docs/generators/payloads), [headers](https://the-codegen-project.org/docs/generators/headers), [parameters](https://the-codegen-project.org/docs/generators/parameters), [protocol helpers](https://the-codegen-project.org/docs/generators/channels), [full clients](https://the-codegen-project.org/docs/generators/client), [models](https://the-codegen-project.org/docs/generators/models), [simple types](https://the-codegen-project.org/docs/generators/types), or all of the above from your [AsyncAPI v2 and v3](https://the-codegen-project.org/docs/inputs/asyncapi)
50+
- 📃 Generate [payloads](https://the-codegen-project.org/docs/generators/payloads), [headers](https://the-codegen-project.org/docs/generators/headers), [parameters](https://the-codegen-project.org/docs/generators/parameters), [models](https://the-codegen-project.org/docs/generators/models), [simple types](https://the-codegen-project.org/docs/generators/types), or all of the above from your [Swagger 2.0, or OpenAPI 3.0, and 3.1](https://the-codegen-project.org/docs/inputs/openapi)
51+
- 📃 Generate [models](https://the-codegen-project.org/docs/generators/models) or [completely customize it](https://the-codegen-project.org/docs/generators/custom) for [JSON Schema Draft-4, Draft-6 and Draft-7](https://the-codegen-project.org/docs/inputs/jsonschema)
52+
- 📊 Every generator fully customizable to fit your hearts desire
53+
- 👀 Integrate it into any project (Demos in [Next.JS](./examples/typescript-nextjs), [TypeScript Libraries](./examples/typescript-library))
5354
- 💅 [Create custom generators to your use-case](https://the-codegen-project.org/docs/generators/custom)
5455
- 🗄️ Protocol agnostic generator ([NATS](https://the-codegen-project.org/docs/protocols/nats), [Kafka](https://the-codegen-project.org/docs/protocols/kafka), [MQTT](https://the-codegen-project.org/docs/protocols/mqtt), [AMQP](https://the-codegen-project.org/docs/protocols/amqp), [event-source](https://the-codegen-project.org/docs/protocols/eventsource), [HTTP Client](https://the-codegen-project.org/docs/protocols/http_client), [WebSocket](https://the-codegen-project.org/docs/protocols/websocket), read the [docs](https://the-codegen-project.org/docs#protocols) for the full list and information)
5556
- ⭐ And much more...

docs/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ If there has been a decision about certain technical solutions it will be marked
4444
Each input has its own limitations, corner cases, and features; thus, each has separate documentation.
4545
- [AsyncAPI](./inputs/asyncapi.md)
4646
- [OpenAPI](./inputs/openapi.md)
47+
- [JSON Schema](./inputs/jsonschema.md)
4748

4849
### Protocols
4950
Each protocol has its own limitations, corner cases, and features; thus, each has separate documentation.
@@ -55,7 +56,7 @@ Each protocol has its own limitations, corner cases, and features; thus, each ha
5556
- [HTTP Client](./protocols/http_client.md)
5657
- [WebSocket client and server](./protocols/websocket.md)
5758

58-
### [Migrations](./contributing.md)
59+
### [Migrations](./migrations/README.md)
5960
Get an overview of how to contribute to the project
6061

6162

docs/inputs/asyncapi.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ There is a lot of overlap with existing tooling, however the idea is to form the
2424
| [`channels`](../generators/channels.md) ||
2525
| [`client`](../generators/client.md) ||
2626
| [`custom`](../generators/custom.md) ||
27+
| [`models`](../generators/custom.md) ||
2728

2829
## Basic AsyncAPI Document Structure
2930

@@ -920,4 +921,4 @@ Short answer: Use the `info.version` field in your AsyncAPI document and conside
920921
Long answer: It's hard to version APIs, there are tons of resources how to handle versioning of your API which is far beyond what we can offer here.
921922

922923
### Can I customize the generated code structure?
923-
Yes, use the `x-the-codegen-project` extension properties to customize channel names, function mappings, and other generation aspects. If you want full control, use the [custom preset](../generators/custom.md)
924+
Yes, use the `x-the-codegen-project` extension properties to customize channel names, function mappings, and other generation aspects or the configuration file [while taking a look at the different generators](../generators).

docs/inputs/openapi.md

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Input support; `openapi`
1919
| [`channels`](../generators/channels.md) ||
2020
| [`client`](../generators/client.md) ||
2121
| [`custom`](../generators/custom.md) ||
22+
| [`models`](../generators/custom.md) ||
2223

2324
## Basic Usage
2425

@@ -59,66 +60,14 @@ Full support for OpenAPI 3.1 features including:
5960
- `if`/`then`/`else` conditionals
6061
- Enhanced `examples` support
6162

62-
### Validation and Error Handling
63-
64-
The parser provides detailed validation errors:
65-
66-
```typescript
67-
// If validation fails, you'll get detailed error information
68-
try {
69-
const document = await loadOpenapi(context);
70-
} catch (error) {
71-
console.error('OpenAPI validation failed:', error.message);
72-
// Error message includes line numbers and specific validation issues
73-
}
74-
```
75-
76-
## Examples
77-
78-
### REST API Client Generation
79-
80-
Generate a complete TypeScript client for your REST API:
81-
82-
```json
83-
{
84-
"inputType": "openapi",
85-
"inputPath": "./api/openapi.yaml",
86-
"language": "typescript",
87-
"generators": [ ]
88-
}
89-
```
90-
91-
## Best Practices
92-
93-
1. **Schema Organization**: Use `$ref` to organize complex schemas into separate files
94-
2. **Validation**: Always validate your OpenAPI documents before generation
95-
3. **Versioning**: Include version information in your API specifications
96-
4. **Documentation**: Use `description` fields extensively for better generated code
97-
5. **Examples**: Provide examples in your schemas for better understanding
98-
9963
## Troubleshooting
10064

101-
### Common Issues
102-
103-
1. **Invalid $ref**: Ensure all referenced files exist and are accessible
104-
2. **Schema Validation**: Check that your OpenAPI document follows the specification
105-
3. **File Format**: Verify that YAML/JSON syntax is correct
106-
4. **Circular References**: Avoid circular `$ref` dependencies
107-
10865
## FAQ
10966

11067
### Can I use both OpenAPI and AsyncAPI in the same project?
11168

11269
Yes! You can have separate configuration files for each input type and generate code to different output directories.
11370

114-
### What's the difference between OpenAPI 3.0 and 3.1?
115-
116-
OpenAPI 3.1 is fully compatible with JSON Schema 2020-12 and includes additional features like `const`, conditional schemas, and enhanced examples support.
117-
118-
### How do I handle authentication in generated clients?
119-
120-
Define security schemes in your OpenAPI document, and the generated client code will include appropriate authentication handling.
121-
12271
### Can I customize the generated code?
12372

124-
Yes, use the custom generator preset to create your own templates and generation logic.
73+
Yes, use the [custom generator](../generators/custom) preset to create your own generation logic.

docs/migrations/v0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ const subscriber = await jetStreamPullSubscribeToReceiveUserSignedup({
5858
});
5959
```
6060

61+
## Breaking Changes 0.55.1
6162

62-
63+
We upgraded the AsyncAPI Modelina dependency to the `next` version so for the next few versions it will contain breaking changes as we continue to improve the tool.
6364

6465

6566

0 commit comments

Comments
 (0)