Skip to content

Commit

Permalink
Add format: int64 to schema marketPartnerId (#9)
Browse files Browse the repository at this point in the history
* Add `format: int64` to schema `marketPartnerId`

* Update README.md

---------

Co-authored-by: Konstantin <konstantin.klein+github@hochfrequenz.de>
  • Loading branch information
hf-kklein and Konstantin authored Oct 2, 2024
1 parent 22cbfed commit db0e68a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Most of the classes are autogenerated from the [`openapi.yml`](openapi/openapi.y
Note that we fixed some errors in the official OpenAPI spec.
Our changes are mentioned at the beginning of the [`openapi.yml`](openapi/openapi.yml) file.

https://github.com/Hochfrequenz/malo-ident-python-models/blob/2e1784c93d000bb7503a9688f1c648059481c2fc/openapi/openapi.yml#L4-L9
https://github.com/Hochfrequenz/malo-ident-python-models/blob/3cfe0aea3cff051303ef5e513d06ab6c5741f21a/openapi/openapi.yml#L4-L10

After updating the `openapi.yml` file, use

Expand Down
2 changes: 2 additions & 0 deletions openapi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# 2. Some yaml parsers fail, because: Multi-line double-quoted strings are not sufficiently indented (can be found with prettier in CI)
# 3. Datetimes are poorly designed. Instead of using the OpenAPI format:date-time, a regex with good intentions is used. This leads to code-generators using type string instead of datetime.
# 4. 'format: UUID RFC4122' may not be recognized but is valid: "Formats such as "email", "uuid", and so on, MAY be used even though undefined by this specification".
# 5. Typing the marketPartnerId as integer is a poor decision. For better compatability, we added the `format: int64`, so that the 13digit values fit (and they don't fit in 32bit).

openapi: 3.0.0
servers:
Expand Down Expand Up @@ -614,6 +615,7 @@ components:
marketPartnerId:
pattern: "\\d{13}"
type: integer
format: int64 # ERROR-5
description: Identifiziert den Marktpartner (Marktpartner-ID)
example: 9900987654321

Expand Down

0 comments on commit db0e68a

Please sign in to comment.