devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

Swagger docs show incorrect property identifier

Open rtull opened this issue 10 years ago • 7 comments

The Swagger generated docs for the REST API show the property identifiers fomatted as camelCase but the responses from Magento 2 use snake_case identifiers.

Examples from docs:

"id": 0, "groupId": 0, "defaultBilling": "string", "defaultShipping": "string", "confirmation": "string", "createdAt": "string", "updatedAt": "string", "createdIn": "string",

Actual API response from Magento 2:

{ "id": 2, "group_id": 1, "created_at": "2016-01-28 20:36:04", "updated_at": "2016-01-28 20:36:05", "created_in": "Default Store View", "email": "[email protected]", "firstname": "Rob", "lastname": "Tull", "store_id": 1, "website_id": 1, "addresses": [], "disable_auto_group_change": 0 }

rtull avatar May 18 '16 14:05 rtull

As a further note, this has already created confusion with a third party we were working with who raised the question of which format they should expect given the disparity between the docs and the actual response.

rtull avatar May 18 '16 14:05 rtull

Yikes. Thanks @rtull for pointing this out. @keharper is this what you are already working owth @paliarush on, or it separate?

tanberry avatar May 18 '16 16:05 tanberry

No, I was unaware of this issue until today.

keharper avatar May 18 '16 16:05 keharper

This is internal issue 53008.

Magento can handle requests in either camelcase or snake_case, but not knowing what you're getting back is a problem. Thanks for reporting the problem.

keharper avatar May 18 '16 21:05 keharper

The Development team will adjust Swagger so that it shows successful responses (200) in snake_case. I'll close this PR when they've completed the work.

keharper avatar May 24 '16 18:05 keharper

MAGETWO-53008 merged to magento/magento2 develop branch

okorshenko avatar Jun 12 '16 14:06 okorshenko

Closing. Thanks for reporting the issue @rtull .

keharper avatar Jun 13 '16 00:06 keharper