Updated YAML File to match API rule for readOnly properties

This commit is contained in:
Daniel Schick 2024-08-29 08:58:28 +02:00
parent e890985e2d
commit 38ed66a638
3 changed files with 243 additions and 228 deletions

File diff suppressed because it is too large Load Diff

View File

@ -566,6 +566,7 @@ components:
evaluation: evaluation:
$ref: '#/components/schemas/EvaluationType' $ref: '#/components/schemas/EvaluationType'
evaluation_message: evaluation_message:
readOnly: true
maxLength: 512 maxLength: 512
type: string type: string
nullable: true nullable: true
@ -964,8 +965,9 @@ components:
- email - email
- push - push
EvaluationType: EvaluationType:
type: string readOnly: true
nullable: true nullable: true
type: string
enum: enum:
- undefined - undefined
- green - green

19
misc/Readme_yaml.md Normal file
View File

@ -0,0 +1,19 @@
# Bremen Calling Open API spec
## Infos zur Generierung der CS Wrapper / Mapping Datei aus YAML
Verwendung von "OpenAPIGenerator" aus dem [Rest API Client Code Generator 2022](https://marketplace.visualstudio.com/items?itemName=ChristianResmaHelle.ApiClientCodeGenerator2022).
Die automatisch generierte Datei muss leider noch nachgearbeitet werden:
1) #pragma warning disable CS8073 (direkt nach der NS declaration).
2) #pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' (am Schluss vor der schließenden Klammer des NS)
3) Für readOnly Properties wird bei einem Enum kein korrekter Code emittiert. Daher muss aktuell folgende Funktion ergänzt werden, damit beim Speichern das "evaluation" Flag nicht mitgesendet wird:
```C++
public bool ShouldSerializeEvaluation()
{
return false;
}
```
Witziger(!)weise funktioniert es für das Property EvaluationMessage korrekt.