From 1bf8d70db0c2b6f501210b93eb9802e05a4f5874 Mon Sep 17 00:00:00 2001 From: Christoph Kappestein Date: Thu, 10 Oct 2024 11:39:08 +0200 Subject: [PATCH] update readme --- README.md | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index b282414..71d6300 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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`. @@ -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/)