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

InboundRule.Sources being an array causing `422 unprocessable_entity: You specified an invalid type for one of the sources error response. #59

Closed
azakhi opened this issue Dec 14, 2019 · 0 comments

Comments

@azakhi
Copy link
Contributor

azakhi commented Dec 14, 2019

According to DigitalOcean API creating firewall section (https://developers.digitalocean.com/documentation/v2/#create-a-new-firewall) sources attribute of InboundRule should be a single object. Providing an array results in an error response as given in title. To be sure I tested following bodies using Postman:

{ "name": "test", "inbound_rules": [ { "protocol": "tcp", "ports": "22", "sources": [ { "addresses": [ "18.0.0.0/8" ] } ] } ] }
Response: { "id": "unprocessable_entity", "message": "You specified an invalid type for one of the sources.", "request_id": "" }

Single object request:
{ "name": "test", "inbound_rules": [ { "protocol": "tcp", "ports": "22", "sources": { "addresses": [ "18.0.0.0/8" ] } } ] }
Response: successfully created firewall

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

No branches or pull requests

2 participants