oanda / v20-openapi

OpenAPI Specification for OANDA's v20 REST API
MIT License
19 stars 9 forks source link

Errors in the definitions ? #2

Open StefanoRaggi opened 7 years ago

StefanoRaggi commented 7 years ago

As a follow-up to my previous issue (#1), I found a few errors in the JSON spec I am using to generate C# bindings. Without the following changes, deserialization errors occurred at runtime.

  1. In PositionSide definition, TradeIds is defined as array of objects instead of array of strings https://github.com/oanda/v20-openapi/blob/master/json/v20.json#L5125 should be: "type": "string", instead of: "$ref": "#/definitions/TradeID"

  2. relatedTransactionIDs and closingTransactionIDs are defined as arrays of objects instead of arrays of strings https://github.com/oanda/v20-openapi/blob/master/json/v20.json#L480 https://github.com/oanda/v20-openapi/blob/master/json/v20.json#L11731 https://github.com/oanda/v20-openapi/blob/master/json/v20.json#L11820 should be: "type": "string", instead of: "$ref": "#/definitions/TransactionID"

  3. OrderPositionFill enum https://github.com/oanda/v20-openapi/blob/master/json/v20.json#L3464 should be: _POSITIONDEFAULT instead of: DEFAULT (also need to update all usages)

  4. OrderTriggerCondition enum https://github.com/oanda/v20-openapi/blob/master/json/v20.json#L3471 should be: _TRIGGERDEFAULT instead of: DEFAULT (also need to update all usages)

This is the modified JSON file I used for generation: v20.zip

dmpettyp commented 7 years ago

Thanks again for the feedback.

1 & 2 are being fixed 3 & 4 are actually implementation bugs, not documentation bugs. We will be fixing the implementation to match the documentation

dmpettyp commented 7 years ago

1&2 should be fixed in the spec now, thanks. 3&4 won't show up until the next release

StefanoRaggi commented 7 years ago

Thanks for the fixes, do you have an ETA for the next implementation release ?

It would be important to know, because we'll have to wait for it before merging this PR: https://github.com/QuantConnect/Lean/pull/821