Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Oct 10, 2024
1 parent edf1431 commit 1bf8d70
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

# API

The API component is the reference implementation of the [TypeAPI](https://typeapi.org/) specification.
It provides models to describe an REST API and generate based on those models different outputs. You can create those
models either by parsing a TypeAPI or OpenAPI specification or by using PHP Attributes. Based on those models it is then
possible to generate i.e. client SDKs.
This library provides an attribute parser to dynamically generate a [TypeAPI](https://typeapi.org/) specification
from any controller (code-first). Based on the specification it is then possible to generate client SDKs or
an OpenAPI specification.

There is also a hosted version of this [code generator](https://typeapi.org/generator) where you can test and play
with the generated code. If you need a CLI binary to generate code you can also take a look at the [SDKgen](https://sdkgen.app/)
project which provides several ways to directly integrate the code generator.

## Usage

Expand Down Expand Up @@ -39,7 +42,7 @@ class MyController

```

This would be then enough for the API component to generate either an OpenAPI specification or a client SDK.
This would be enough for the API component to generate either an OpenAPI specification or a client SDK.
Note this library only needs the meta information, if you can get those meta information at your framework in another
way you can also implement a custom `ParserInterface`.

Expand Down Expand Up @@ -85,21 +88,3 @@ $generator = $registry->getGenerator(\PSX\Api\Repository\LocalRepository::CLIENT
$source = $generator->generate($resource);

```

## Generator

### Client

- PHP
- Typescript

### Markup

- Client
- HTML
- Markdown

### Spec

- [OpenAPI](https://github.com/OAI/OpenAPI-Specification)
- [TypeAPI](https://typeapi.org/)

0 comments on commit 1bf8d70

Please sign in to comment.