Commit 0f1afc26 authored by Sylvain Renault's avatar Sylvain Renault
Browse files

Now, the new config file (.json) has to be used.

parent 92ec7b14
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -2,6 +2,19 @@
  "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "5.3.0"
    "version": "5.3.0",
    "generators":{
      "v1.1": {
     "generatorName": "aspnetcore",
     "output": "./server/worldstorage",
     "inputSpec": "./openapi/API/worldstorage/worldstorageopenapi.yaml",
     "additionalProperties": {
       "aspnetCoreVersion": "5.0",
       "packageName": "ETSI.ARF.OpenAPI.WorldStorage",
       "operationModifier": "abstract",
       "classModifier": "abstract"
      }
    }
    }
  }
}
+28 −2
Original line number Diff line number Diff line
@@ -38,12 +38,38 @@ What you need:

# Code Generation

We provided the file `.openapi-generator-ignore` in `server`, which prevents openapi-generator to override some adapted files.
We provide the file `.openapi-generator-ignore` in `server`, which prevents openapi-generator to override some adapted files.

## Auto-generate server code

Use/define following setup for the config file `openapitools.json`:

```
{
  "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "5.3.0",
    "generators":{
      "v1.1": {
     "generatorName": "aspnetcore",
     "output": "./server/worldstorage",
     "inputSpec": "./openapi/API/worldstorage/worldstorageopenapi.yaml",
     "additionalProperties": {
       "aspnetCoreVersion": "5.0",
       "packageName": "ETSI.ARF.OpenAPI.WorldStorage",
       "operationModifier": "abstract",
       "classModifier": "abstract"
      }
    }
    }
  }
}
```

Open a command shell and execute:
```
  npx openapi-generator-cli generate -i openapi/API/worldstorage/worldstorageopenapi.yaml --additional-properties aspnetCoreVersion=5.0,packageName=ETSI.ARF.OpenAPI.WorldStorage,operationModifier=abstract,classModifier=abstract -g aspnetcore -o server/worldstorage
  npx openapi-generator-cli generate
```

Open the solution `ETSI.ARF.OpenAPI.WorldStorage.sln` (folder `server/worldstorage`) in Visual Studio: