Closed philipengberg closed 6 years ago
Understood. Changing it would be easy, but I don't know how much stuff is using those particular id's, so it might break a lot of stuff 🤷♂️
But I do agree, they should be the same for consistency's sake.
Do you want me to do a PR? Then you can decide whether to merge it or not 🙂
It's not something set by the application, but by the database, so a PR can't change it unfortunately.
Not sure I'm comfortable with the change, because it breaks backwards compatibility for quite a few applications. I agree that it should be named differently, but I also want to preserve backwards compatibility to an extent.
I see, alright 🙂 I understand. Are you aware of similar cases elsewhere in the data model?
That't the only one I've been made aware of. Most of the endpoints have very little overlap for the launches, except the rocket name, core serials, cap serials, and the launch site.
Cool thanks :)
By the way, if any, how many apps are you aware of that is using this API?
Some projects in the GitHub org use it, and I've also seen this app.
But in addition, just searching the api url on Github gives back 1,039 results in public repos alone. While the bigger projects here in the org could switch easily, I worry more about the +95% that are unknown to myself and the org.
If you have any ideas about how this could be solved while retaining backwards compatibility, I'm completely on board, because you shouldn't have to jump through crazy hoops just to use the data easily.
Would it be feasible to edit the resulting object for those endpoints only? It wouldn't be difficult to duplicate those properties onto a different key. I imagine a middleware could be created for anything matching a certain regex, which could edit the results accordingly.
On Thu, Aug 23, 2018, 14:07 Jake Meyer notifications@github.com wrote:
Some projects in the GitHub org https://github.com/r-spacex use it, and I've also seen this app https://play.google.com/store/apps/details?id=com.danielscholte.spacexlaunches .
But in addition, just searching the api url on Github gives back 1,039 results in public repos alone. While the bigger projects here in the org could switch easily, I worry more about the +95% that are unknown to myself and the org.
If you have any ideas about how this could be solved while retaining backwards compatibility, I'm completely on board, because you shouldn't have to jump through crazy hoops just to use the data easily.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/r-spacex/SpaceX-API/issues/133#issuecomment-415514958, or mute the thread https://github.com/notifications/unsubscribe-auth/ADA9M8hPNCZngEdQlatyVOBAj1kLHJheks5uTu9zgaJpZM4WGa1e .
I just came across a similar case:
/launces
has
"launch_site": {
"site_id": "kwajalein_atoll",
"site_name": "Kwajalein Atoll",
"site_name_long": "Kwajalein Atoll Omelek Island"
},
whereas /launchpads
has
{
"padid": 1,
"id": "kwajalein_atoll",
"full_name": "Kwajalein Atoll Omelek Island",
}
@jhpratt They could be easily edited before shipping the json out.
I see two potential solutions here:
Options 1 is the lowest overhead option by far, and I can't imagine that option 2 won't have any performance hit for subbing a ton of the json objects for every response.
Honestly at this point, I think I'd just rather change the keys outright, because I'd also like to tweak the launch schema slightly, to remove some redundant fields.
@jakewmeyer Maybe create some benchmarks for basic key replacement? I don't think it will be as much of a difference as you're expecting; the value is stored by reference, so all that would be required server-wise is assigning a key to an integer (the pointer), while removing the old pointer.
I'll run some tests
Negligible performance difference, one example is live for rockets. https://api.spacexdata.com/v3/rockets
Awesome 👏
Just wanna make sure that you are aware of two very similar properties on that endpoint now: rocketid
and rocket_id
. There might be some serializers that aren't happy about that?
Maybe rocketid
should just be id
?
It should be just id. In #1 there was a feature request for it, and because we already had an id
field, it din't make sense at the time. Now that we have rocket_id
instead, an id
field makes more sense.
Rockets and Launchpads are done
https://api.spacexdata.com/v3/rockets https://api.spacexdata.com/v3/launchpads
Let me know if you find any other inconsistencies
@jakewmeyer Just to be clear: Is it only the /rockets
and /launchpads
endpoints that have been bumped to /v3
?
Correct. All the other endpoints will be added to v3 likely over the weekend, or as soon as I finish up the ships data, and add the ship id's to launches.
I won't officially release v3 for a few weeks, but as I add the new ones, they will become available.
Also planning on making the endpoints a bit more REST friendly for v3. Currently these are the v2 endpoints:
https://api.spacexdata.com/v2/launches https://api.spacexdata.com/v2/launches/all https://api.spacexdata.com/v2/launches/latest https://api.spacexdata.com/v2/launches/next https://api.spacexdata.com/v2/capsules https://api.spacexdata.com/v2/rockets https://api.spacexdata.com/v2/launchpads https://api.spacexdata.com/v2/parts/cores https://api.spacexdata.com/v2/parts/caps https://api.spacexdata.com/v2/info https://api.spacexdata.com/v2/info/history https://api.spacexdata.com/v2/info/missions https://api.spacexdata.com/v2/info/roadster
Some are too nested, and some don't accept any kind of query parameters. v3 will look like this:
https://api.spacexdata.com/v3/launches https://api.spacexdata.com/v3/launches/latest https://api.spacexdata.com/v3/launches/next https://api.spacexdata.com/v3/launches/upcoming https://api.spacexdata.com/v3/launches/past https://api.spacexdata.com/v3/dragons https://api.spacexdata.com/v3/rockets https://api.spacexdata.com/v3/launchpads https://api.spacexdata.com/v3/capsules https://api.spacexdata.com/v3/cores https://api.spacexdata.com/v3/info https://api.spacexdata.com/v3/history https://api.spacexdata.com/v3/missions https://api.spacexdata.com/v3/roadster https://api.spacexdata.com/v3/ships
Nice to know, getting ready to publish my Python wrapper for the API and currently implementing V3 rocket and launch. Knowing this I can get ready for same day push update.
Not deprecating v2 in the foreseeable future. Creating v3 with backwards compatibility in mind.
Thanks for an amazing API. I'm working on an iOS app that will consume more or less the whole thing 🚀
I've come across one peculiarity, however. On
/rockets
the properties look like this:whereas on
/launces
those properties are prepended withrocket_
like this:This makes it a little more troublesome to make global model serialization.
Is there a reason for this misalignment? 🙂
Cheers 🙌