netbox-community / pynetbox

Python API client library for Netbox.
Apache License 2.0
567 stars 168 forks source link

Update OpenAPI endpoint for 3.5 #547

Closed devon-mar closed 1 year ago

devon-mar commented 1 year ago

This breaks compatibility for older versions of NetBox.

If compatibility is desired, we can try the v3.5 endpoint first then attempt the older endpoint.

K0HAX commented 1 year ago

I think the schema URL needs to be {}schema/?format=json, rather than {}schema for this to work. At least in my testing that's what I had to do.

devon-mar commented 1 year ago

@K0HAX I misread the header that we're sending as Accept for some reason, that's why I left it out. I'm not sure why the original implementation was sending the Content-Type header in the request so I changed that to Accept so that NetBox returns JSON.

abhi1693 commented 1 year ago

This will be superseded by #564 once that's merged.