Giter Site home page Giter Site logo

core/cap issues about spacex-api HOT 9 CLOSED

r-spacex avatar r-spacex commented on April 28, 2024
core/cap issues

from spacex-api.

Comments (9)

jakewmeyer avatar jakewmeyer commented on April 28, 2024

Wiki endpoint is corrected

Would it make sense to only return a single object though? Since there's the possibility for multiple results when you search all cores/caps, wouldn't that lead to inconsistency? Especially if more parameters are added to those endpoints in the future.

from spacex-api.

waterskier2007 avatar waterskier2007 commented on April 28, 2024

All caps/cores should return an array, but by definition, if you're getting a single cap/core, IMO it doesn't make sense to return an array, as a serial should point to a single result.

I'll leave it up to you :)

from spacex-api.

HarvsG avatar HarvsG commented on April 28, 2024

from spacex-api.

waterskier2007 avatar waterskier2007 commented on April 28, 2024

from spacex-api.

waterskier2007 avatar waterskier2007 commented on April 28, 2024

Here's an example of some endpoints taken from https://msdn.microsoft.com/en-us/library/dd203052.aspx

http://i.imgur.com/vLZirxn.jpg

Notice how the single object endpoints say "an individual..." vs. "a collection of..."

from spacex-api.

HarvsG avatar HarvsG commented on April 28, 2024

Ok, I am with you now. Where the requester is expecting only a single object then it should not be an array. But in instances where the user is expecting 'one or more' objects it should always return an array even if there is only one object. E.g if it is a search term endpoint or something like launches/upcoming

from spacex-api.

waterskier2007 avatar waterskier2007 commented on April 28, 2024

@HarvsG absolutely. If it's a request for an unknown amount (0, 1, however many) it should (and kind of has to) be an array. But for the case where you're requesting a single object by ID (in this case core or cap serial) it should be a single object

from spacex-api.

HarvsG avatar HarvsG commented on April 28, 2024

from spacex-api.

jakewmeyer avatar jakewmeyer commented on April 28, 2024

Glad we all agree, I'll go ahead and merge 👍

from spacex-api.

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.