|
23 | 23 |
|
24 | 24 | ## Projects in the repository
|
25 | 25 |
|
26 |
| -|Project|Target Framework|Description|Docs|Nuget Download Link| |
27 |
| -|---|---|---|---|---| |
28 |
| -|[Atc.Rest.ApiGenerator](src/Atc.Rest.ApiGenerator)|net6.0|Atc.Rest.ApiGenerator is a WebApi C# code generator using a OpenApi 3.0.x specification YAML file.|[References](docs/CodeDoc/Atc.Rest.ApiGenerator/Index.md)<br/>[References extended](docs/CodeDoc/Atc.Rest.ApiGenerator/IndexExtended.md)|[](https://www.nuget.org/packages/Atc.Rest.ApiGenerator)| |
29 |
| -|[Atc.Rest.ApiGenerator.CLI](src/Atc.Rest.ApiGenerator.CLI)|net6.0|A CLI tool that use Atc.Rest.ApiGenerator to create/update a project specified by a OpenApi 3.0.x specification YAML file.||[](https://www.nuget.org/packages/atc-rest-api-generator)| |
| 26 | +|Project|Target Framework|Description|Nuget Download Link| |
| 27 | +|---|---|---|---| |
| 28 | +|[Atc.Rest.ApiGenerator](src/Atc.Rest.ApiGenerator)|net6.0|Atc.Rest.ApiGenerator is a WebApi C# code generator using a OpenApi 3.0.x specification YAML file.|[](https://www.nuget.org/packages/Atc.Rest.ApiGenerator)| |
| 29 | +|[Atc.Rest.ApiGenerator.CLI](src/Atc.Rest.ApiGenerator.CLI)|net6.0|A CLI tool that use Atc.Rest.ApiGenerator to create/update a project specified by a OpenApi 3.0.x specification YAML file.|[](https://www.nuget.org/packages/atc-rest-api-generator)| |
30 | 30 |
|
31 | 31 | ## CLI Tool
|
32 | 32 |
|
33 | 33 | The `atc-rest-api-generator` is a cross platform command line application known as CLI tool.
|
34 | 34 |
|
35 |
| -The main purpose of this application is to create and maintain a REST-API service based on an Open-API specification file. So the consept is the `Design First` approse. |
36 |
| -And the `atc-rest-api-generator` should be categorized as a `Rapid Application Development Tool` for REST-API in .NET/C#. |
| 35 | +The main purpose of this application is to create and maintain a REST-API based on an Open-API specification file using a `Design First` approach. |
| 36 | + |
| 37 | +The `atc-rest-api-generator` can be categorized as a `Rapid Application Development Tool` for REST-API in .NET/C#. |
37 | 38 |
|
38 | 39 | ## Prerequisites
|
39 | 40 |
|
40 |
| -To get the benefit out of this CLI tool, a `Design first approach` of the REST API in a `OpenAPI specification` should be made. The CLI tool needs at least a `OpenAPI specification` in a `yaml` or `json` file format, to work with as argument value for parameter `--specificationPath` or the short-version `-s`. |
| 41 | +To get the benefit out of this CLI tool, a `Design first` approach of the REST API in a `OpenAPI specification` should be in effect. The CLI tool needs a `OpenAPI specification` in `yaml` or `json` file format provided as the argument value for parameter `--specificationPath` or the short-hand-version `-s`. |
41 | 42 |
|
42 | 43 | Read more about REST API design in [ATC DevOps Playbook](https://atc-net.github.io/manuals/devops-playbook#rest-api-design).
|
43 | 44 |
|
@@ -198,6 +199,19 @@ atc-rest-api-generator generate server all `
|
198 | 199 | -v
|
199 | 200 | ```
|
200 | 201 |
|
| 202 | +The following is generated by running the above command: |
| 203 | + |
| 204 | +```mermaid |
| 205 | +flowchart TB; |
| 206 | + CMD[command: generate server all] --> HOST[Host project] & API[API project] & DOMAIN[Domain project]; |
| 207 | + HOST-.-> API; |
| 208 | + API-.-> DOMAIN; |
| 209 | +``` |
| 210 | + |
| 211 | +- The Host-project is the layer for the `.NET WebApi` application. Project suffix: `.Api`. |
| 212 | +- The API-project is the layer with all the contracts, interfaces, result classes and endpoints. Project suffix: `.Api.Generated`. |
| 213 | +- The Domain-project is the layer where handlers can be implemented with necessary business logic. Project suffix: `.Domain`. |
| 214 | + |
201 | 215 | Running the above command produces the following output:
|
202 | 216 |
|
203 | 217 | ```powershell
|
@@ -291,26 +305,13 @@ Running the above command produces the following output:
|
291 | 305 | ✅ Done
|
292 | 306 | ```
|
293 | 307 |
|
294 |
| -After the generator is finished running, the API can be started by running the following command: |
| 308 | +After the generator finishes running, the API can be started by executing the following command: |
295 | 309 |
|
296 | 310 | ```powershell
|
297 | 311 | dotnet run --project C:\PetStore\src\PetStore.Api
|
298 | 312 | ```
|
299 | 313 |
|
300 |
| -And then open a browser with url: [https://localhost:5001/swagger](https://localhost:5001/swagger) |
301 |
| - |
302 |
| -The following is generated by running the above command: |
303 |
| - |
304 |
| -```mermaid |
305 |
| -flowchart TB; |
306 |
| - CMD[command: generate server all] --> HOST[Host project] & API[API project] & DOMAIN[Domain project]; |
307 |
| - HOST-.-> API; |
308 |
| - API-.-> DOMAIN; |
309 |
| -``` |
310 |
| - |
311 |
| -- The Host-project is the layer for the `.NET WebApi` application. Project suffix: `.Api`. |
312 |
| -- The API-project is the layer with all the contracts, interfaces, result classes and endpoints. Project suffix: `.Api.Generated`. |
313 |
| -- The Domain-project is the layer where handlers can be implemented with necessary business logic. Project suffix: `.Domain`. |
| 314 | +And then open a browser and navigate to the url: [https://localhost:5001/swagger](https://localhost:5001/swagger) |
314 | 315 |
|
315 | 316 | ## Security - supporting role-based security and custom authentication-schemes
|
316 | 317 |
|
|
0 commit comments