Skip to content

Commit

Permalink
Add link to better openapi.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-kklein authored Oct 2, 2024
1 parent 47fffc5 commit 4f02f9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <!-- as you'd expect from edi@energy -->:
- 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).
Expand Down

0 comments on commit 4f02f9e

Please sign in to comment.