Commit 122e4184 authored by Sylvain Renault's avatar Sylvain Renault Committed by Jérémy Lacoche
Browse files

Readme: only for using generators, not generating code.

parent 84c2c099
Loading
Loading
Loading
Loading
+16 −8
Original line number Original line Diff line number Diff line
@@ -92,18 +92,19 @@ Contains temporary office documents that are edited collaboratively and all othe
- Codegen
- Codegen
  - [Swagger Codegen](https://swagger.io/tools/swagger-codegen/)
  - [Swagger Codegen](https://swagger.io/tools/swagger-codegen/)
  - [Swagger Codegen documentation](https://swagger.io/docs/open-source-tools/swagger-codegen/)
  - [Swagger Codegen documentation](https://swagger.io/docs/open-source-tools/swagger-codegen/)
  - [NSwag](https://github.com/RicoSuter/NSwag)


## Development tools
## Development tools


- Visual Studio
- Visual Studio
- Visual Studio Code
- Visual Studio Code
- Unity 3D (Version 2020.3 LTS)
- Unity 3D (Version 2022.3 LTS)


# Creating Server/Client Code
# Creating Server/Client Code


## Tool: openapi-generator
## Tool: openapi-generator


We recommand the usage of the open source command-line tool **openapi-generator** while it has a good compatibility to API v3.x and produces accurate source code, similar to Swagger.
We recommand the usage of the open source command-line tool **openapi-generator** while it has a good compatibility to API v3.x and produces accurate source code, similar to Swagger. Special for C# project and especially for code generation for Unity (C# scripts) we recommand th useage of the free tool **NSwag**. NSwag create a light-weight code  


Find a description here: https://openapi-generator.tech/docs/usage/
Find a description here: https://openapi-generator.tech/docs/usage/


@@ -117,17 +118,24 @@ Install the tool with "npm", see: https://openapi-generator.tech/docs/installati


> npx @openapitools/openapi-generator-cli validate -i API/openapi.yaml
> npx @openapitools/openapi-generator-cli validate -i API/openapi.yaml


### Example C++ Server (Pistache)
If you need some recommandation, use the option: --recommand


> npx @openapitools/openapi-generator-cli generate -i API/openapi.yaml  -g cpp-pistache-server -o ./CodeGeneration/sever/cpp/pistache
### Creating the code for server or client


### Example ASP.NET Server (C#)
Without any arguments, the openapi-generator-cli uses the configuration found in the file 'openapitools.json'.
Run this command in a shell.


> npx @openapitools/openapi-generator-cli generate -i API/openapi.yaml -g aspnetcore -o ./CodeGeneration/server/aspnetcore
> npx @openapitools/openapi-generator-cli generate


### Example C# Client
You will find the correct setup files in the corresponding implementation of the interface in the ETSI GitLab.npx nswag run nswag_data.json


> npx @openapitools/openapi-generator-cli generate -i API/openapi.yaml  -g csharp -o ./CodeGeneration/client/csharp
### Creating lightweight C# and ASP.NET code with NSwag

You have to setup NSwag through a json or xml configuration file, here e.g. a file 'nswag.json' and run this in a shell:

> npx nswag run nswag.json

You will find the correct setup files in the corresponding implementation of the interface in the ETSI GitLab.


# Branching Policy
# Branching Policy
Distributed version control systems like Git offers developers great flexibility to share and manage code. But a branching policy is crucial to collaborate more easily while keeping track of releases with bug fixes.
Distributed version control systems like Git offers developers great flexibility to share and manage code. But a branching policy is crucial to collaborate more easily while keeping track of releases with bug fixes.