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

fix: remove .json suffix from entity requests #90

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Conversation

jaark
Copy link

@jaark jaark commented Nov 22, 2024

Netbox 4.1 throws an error if '.json' is appended to API requests. Previous versions silently ignored this deviation from the published API spec. This change corrects the requests for entities.

eg.
GET /api/ipam/ip-addresses/1/

instead of
GET /api/ipam/ip-addresses/1.json

Fixes #89

@thde
Copy link
Member

thde commented Nov 27, 2024

Thank you for the PR! The specs URL's will also need to be adjusted for them to succeed. For example:

let(:request_url) { "#{base_url}#{entity_id}.json" }

@jaark
Copy link
Author

jaark commented Nov 28, 2024

Sorry, I didn't notice the spec tests. They should be fixed now.
But... I am still seeing a single failure. I'm not sure where that is. I don't think it has anything to do with my changes as I get the same issue from the main tree, It looks like it might be something to do with the version of faraday here.

@thde thde changed the title Remove .json suffix from entity requests. fix: remove .json suffix from entity requests. Dec 2, 2024
@thde thde changed the title fix: remove .json suffix from entity requests. fix: remove .json suffix from entity requests Dec 2, 2024
@thde thde merged commit 8d0dbae into ninech:master Dec 2, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

.json suffix on API requests no longer works (netbox 4).
2 participants