Skip to content

Commit cfe803e

Browse files
committed
fix: use "number" instead of "double" for format
The server sends down 'condition: 1' even though the format is listed as 'double' which at least the Dart OpenAPI generator treats very strictly as a floating point which '1' does not parse as (it parses as an integer). OpenAPI does seem to have distinct types for "integer", "number" and "double", since the server isn't always including the dot, I guess this type should be "number". At least that would fix the current OpenAPI dart generator. If you believe the open api generator is at fault, I'm open to fixing that instead.
1 parent 20e2b91 commit cfe803e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

models/ShipComponentCondition.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "number",
3-
"format": "double",
3+
"format": "number",
44
"description": "The repairable condition of a component. A value of 0 indicates the component needs significant repairs, while a value of 1 indicates the component is in near perfect condition. As the condition of a component is repaired, the overall integrity of the component decreases.",
55
"minimum": 0,
66
"maximum": 1

models/ShipComponentIntegrity.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "number",
3-
"format": "double",
3+
"format": "number",
44
"description": "The overall integrity of the component, which determines the performance of the component. A value of 0 indicates that the component is almost completely degraded, while a value of 1 indicates that the component is in near perfect condition. The integrity of the component is non-repairable, and represents permanent wear over time.",
55
"minimum": 0,
66
"maximum": 1

0 commit comments

Comments
 (0)