Skip to content

(OpenAPI) Add OpenAPI descrpitions

Michal Zander requested to merge mzander/openapi into develop

#75 (closed)

Rebased on newset !193 (merged) changes

Runs on haf_api_node from MR:

haf_api_node!12 (merged)

still there is an issue with array parameters like operation-types in hafbe/block-numbers , array parameters needs to be in {} but swagger does it diffrently (works correctly in normal usage,in the api description is an example call to verify that)

i've changed the script openapi_rewrite.sh and hardcoded the paths to endpoints, endpoint definitions must be in correct order

in openapi definitions by the lenght of the REST route from the shortest to longest (looks nicer)

in rewrite rules must be reversed (from longest to shortest)

for example if rewrite rules would look like this:

hafbe/accounts/blocktrades/operations

hafbe/accounts/blocktrades/operations/count

nginx would chose always the first rewrite rule hafbe/accounts/blocktrades/operations even tho the call would be for hafbe/accounts/blocktrades/operations/count

EDIT:

bug with operation-types fixed by changing the type of the param to text and converting the string to array, this way swagger doesn't have a problem with sending this parameter further.

Edited by Michal Zander

Merge request reports