From 4f02f9e9f30affd36a23ee99166c0d48b80a0b36 Mon Sep 17 00:00:00 2001 From: konstantin Date: Wed, 2 Oct 2024 13:50:42 +0200 Subject: [PATCH] Add link to better openapi.yml --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d833b70..bf2e9ed 100644 --- a/README.md +++ b/README.md @@ -38,10 +38,12 @@ But although auto-generation of code is theoretically possible, the classes are - It's missing the `measured` valued which is given as example but not part of the enum members (or the example is wrong). - there is a typo in a enum member: `nonActice` should be `nonActive` 2. Although the OpenAPI is syntactically valid, it is poorly designed : - - For datetimes, instead of using the obvious and easy choice - the dedicated [`date-time` format](https://swagger.io/docs/specification/v3_0/data-models/data-types/#string-formats), the OpenApi by EDI@Energy uses wild regex patterns (e.g. `creationDateTime`: `20(\\d{2}(\\-(0[13578]|1[02])\\-(0[1-9]|[12]\\d|3[01])|\\-02\\-(0[1-9]|1\\d|2[0-8])|\\-(0[469]|11)\\-(0[1-9]|[12]\\d|30))|([02468][048]|[13579][26])\\-02\\-(29))T([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(\\.[\\d]{1,4})?Z` - are you serious?). My best guess is, that they're too afraid of !=0 UTC offsets. + - For datetimes, instead of using the obvious and easy choice - the dedicated [`date-time` format](https://swagger.io/docs/specification/v3_0/data-models/data-types/#string-formats), the OpenApi by EDI@Energy uses wild regex patterns (e.g. `creationDateTime`: `20(\\d{2}(\\-(0[13578]|1[02])\\-(0[1-9]|[12]\\d|3[01])|\\-02\\-(0[1-9]|1\\d|2[0-8])|\\-(0[469]|11)\\-(0[1-9]|[12]\\d|30))|([02468][048]|[13579][26])\\-02\\-(29))T([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(\\.[\\d]{1,4})?Z` - are you serious?). - For the property `marketPartnerId`, the type `integer` (together with a `\d{13}` pattern) was used, although `string` would be the right choice (for the same reasons as you don't use integer for Postleitzahlen or MaLo-IDs). As a consequence, the autogenerated code uses type `int`, but the 13-digit number is too large for a plain int32. 3. (Technical) We wanted to use System.Text.Json in .NET8 (and not Newtonsoft in .NET6) and did not find a a working code generator. +We maintain a better version of the `openapi.yml` without all the shortcomings in the Python version: [Hochfrequenz/malo-ident-python-models/openapi/openapi.yml](https://github.com/Hochfrequenz/malo-ident-python-models/blob/main/openapi/openapi.yml) + ## See also We also maintain a [Python version of this data model](https://github.com/Hochfrequenz/malo-ident-python-models).