Giter VIP home page Giter VIP logo

Comments (4)

esnible avatar esnible commented on June 16, 2024

Also note that this API seems to respect ?offset= but not limit= or page=.

from dependency-track.

nscuro avatar nscuro commented on June 16, 2024

That not all fields are returned for every API endpoint is kind of intended. Component has lots of fields, some of them are large themselves (e.g. directDependencies). Listing components of a project thus becomes expensive, due to network and serialization cost alone.

Ideally, listing many components would only yield surface-level fields such as identifiers. For more details, each component would need to be requested explicitly (or in bulk by providing multiple UUIDs for example).

I do agree that the API spec needs to make such behavior clear though. The fact that it doesn't is a symptom of reusing the same model classes across all endpoints.

Also note that this API seems to respect ?offset= but not limit= or page=.

Also agree. The reason those are currently not part of the OpenAPI spec, is that they are implicit, and not every endpoint has explicit definitions for them. The good news is that this is easily solvable for us using the ApiImplicitParam annotation.

There are multiple improvements towards the OpenAPI spec coming in v4.11, I might be able to squeeze that in as well. It's literally just copy-pasting annotations hopefully.

from dependency-track.

nscuro avatar nscuro commented on June 16, 2024

Sorry, misread what you meant with:

Also note that this API seems to respect ?offset= but not limit= or page=.

I think the parameters you're looking for are pageNumber and pageSize. Those are used by the frontend as well, it is what enables the paging in the Project -> Components tab.

This kind of alludes to what I mentioned in my answer above: The pagination parameters are missing from the OpenAPI spec.

from dependency-track.

nscuro avatar nscuro commented on June 16, 2024

Documentation for pagination parameters is coming with #3625.

from dependency-track.

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.