Giter Club home page Giter Club logo

Comments (5)

glennmatthews avatar glennmatthews commented on September 25, 2024

The technical reason for this discrepancy appears to be because InterfaceFilterSet.device filter is a custom method filter (to account for interfaces on devices that are part of a virtual-chassis), which is explicitly returning queryset.none() in the case of DeviceDoesNotExist exception. Fixing this is probably as simple as changing that exception handling logic to raise an appropriate 400 error.

from nautobot.

nrnvgh avatar nrnvgh commented on September 25, 2024

Would an HTTP 404 be a better response code for this class of conditions?

from nautobot.

glennmatthews avatar glennmatthews commented on September 25, 2024

related: #5867

from nautobot.

lampwins avatar lampwins commented on September 25, 2024

My preference to remain REST compliant is that we return 0 results. This is technically a change in behavior so we will defer this to 3.0.

from nautobot.

nrnvgh avatar nrnvgh commented on September 25, 2024

I've not even attempted an exhaustive test to see which API calls return a 400, but as a data point, I did just trip over the fact that /relationship-associations/ returns a 400 if the passed relationship argument which doesn't exist:

{
  "relationship": [
    "Select a valid choice. foo is not one of the available choices."
  ]
}

...but returns a 200/OK with count=0 if you pass an id parameter which doesn't exist. As this seemed so closely related, I added it to this issue but LMK if you'd prefer I open a new issue on this.

from nautobot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.