Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to application json content type #28

Merged

Conversation

mtmail
Copy link
Contributor

@mtmail mtmail commented Jul 20, 2018

I had trouble running consumer.create against a Kong v0.14 instance. Server returned

# --- Caused by: ---
     # Kong::Error:
     #   {"fields":{"@entity":["at least one of these fields must be non-empty:
'custom_id', 'username'"]},"name":"schema violation","code":2,
"message":"schema violation (at least one of these fields must be
non-empty: 'custom_id', 'username')"}
     #   /ruby/path/.rvm/gems/ruby-2.5.1/gems/kong-0.3.2/lib/kong/client.rb:232:in 
`handle_error_response'

Of course one field (username) was filled but filling both made no difference. Used to work in Kong v0.11.

Some testing revealed switching the content-type for POST requests works. Tested against Kong v0.11 and v.0.14.

I can't quite explain which change in the Kong server logic caused this. Logic is likely in https://github.com/Kong/kong/commits/master/kong/api/arguments.lua Their upgrade/migration/changelog notes and issue tracker doesn't list anything relevant.

@kke kke added the bug label Jul 23, 2018
@kke kke requested a review from nevalla July 23, 2018 06:12
Copy link
Contributor

@nevalla nevalla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Thanks!

@nevalla nevalla merged commit 7bcf945 into kontena:master Sep 7, 2018
nevalla added a commit that referenced this pull request Sep 7, 2018
nevalla added a commit that referenced this pull request Sep 7, 2018
* Fix tests after #27 and #28

* Update rubocop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants