Actions
Bug #16415
closedapi/v2/ptables accepts only wrapped hash of attributes with "layout"
Description
# rpm -qa foreman foreman-1.13.0-0.develop.201608221148git5908bf4.el7.noarch # rpm -qa katello katello-3.1.0-4.nightly.el7.noarch
Partition table API endpoint has changed behavior in JSON it accepts.
The payload now needs to follow jsonapi standard in order to be accepted, bringing inconsistency to api/v2:
Old (consistent) way:
# curl -ku admin:changeme -H 'Content-Type: application/json' -d '{"name":"foo1", "layout":"my_layout"}' https://katello.server.com/api/v2/ptables { "error": {"id":null,"errors":{"template":["can't be blank"],"layout":["can't be blank"]},"full_messages":["Template can't be blank","Layout can't be blank"]} }
New format:
]# curl -ku admin:changeme -H 'Content-Type: application/json' -d '{"ptable":{"name":"foo1", "layout":"my_layout"}}' https://hp-dl380pgen8-02-vm-3.lab.bos.redhat.com/api/v2/ptables {"layout":"my_layout","os_family":null,"created_at":"2016-09-01 13:25:18 UTC","updated_at":"2016-09-01 13:25:18 UTC","name":"foo1","id":79,"operatingsystems":[],"locations":[],"organizations":[]}
Updated by Dominic Cleal over 8 years ago
- Subject changed from api/v2/ptables accepts only jsonapi-formatted payload to api/v2/ptables accepts only wrapped hash of attributes
- Difficulty deleted (
trivial)
When did this change? Versus the 1.12.x release series, or a very recent nightly?
Updated by Dominic Cleal over 8 years ago
- Subject changed from api/v2/ptables accepts only wrapped hash of attributes to api/v2/ptables accepts only wrapped hash of attributes with "layout"
Possibly from #7096, looks ancient to me. The "layout" attribute isn't a known wrapped attribute as it's only a model alias of "template" for pre-STI compatibility - it should be explicitly listed in the controller.
Updated by The Foreman Bot over 8 years ago
- Status changed from New to Ready For Testing
- Assignee set to Shlomi Zadok
- Pull request https://github.com/theforeman/foreman/pull/3817 added
Updated by Shlomi Zadok over 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset eb9a7a4973790e27ba930640407eb77d7aa97d65.
Updated by Dominic Cleal over 8 years ago
- Translation missing: en.field_release set to 181
Updated by Dominic Cleal over 8 years ago
- Translation missing: en.field_release changed from 181 to 160
Issue not present in 1.12-stable, probably due to wrap_parameters changing behaviour with strong params.
Actions