-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to use PSCID in place of CandID in the candidates API. #8138
Conversation
@xlecours Can you help me update the swagger schema and review? I looked into |
That versioning is really annoying. I think it could go in v0.0.3 since it does not break anything. |
@driusan If you want to add in 0.0.4-dev, then you need to add the part that differ from 0.0.3 in modules/api/static/schema-v0.0.4-dev.yml (with the components definitions and all.) Otherwise, I would change |
It would break scripts that assume it's the case on v0.0.3 on instances where it's not the case. |
But maybe it would be reasonable to release it as v0.0.4 and remove |
And remove v0.0.3 ? I don't think we can afford to maintain multiple versions of the api. |
This adds the ability to use PSCID instead of CandID in the URL for the v0.0.4-dev version of the API. All endpoints under /candidates/{candID} should now accept /candidates/{PSCID} instead, as long as there's one single unique PSCID with that identifier.
I incorporated the changes from the v0.0.4-dev into the 0.0.3 schema and then copied it back on top of the I had to do the candid->id changes manually because "candid" is a substring of "candidate" so it wasn't easy to do with a regex without breaking other things. It's possible I screwed something up. I don't understand why we would remove 0.0.3 once 0.0.4 is released. It's 99% unchanged endpoints and usually only new ones are added. People are using the API and I don't see why we would need to remove it or have much maintenance to do before something breaks. @ridz1208 I think @xlecours is away for a bit, can you review this now that the swagger schema is (hopefully) updated? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the versionning that is triggering me. I think this PR looks fine, the only usecase that this would not work is if the a study configures the PSCID to be formatted exactly like our CandID and it happens that one of the PSCIDS has a matching candID. I would say the odds of that are very low (I only know 1 study that uses that format) but a failsafe could be added to confirm that the PSCID configuration is NOT 6 digits
I think it should be mentioned that in the eventuality of a candid-pscid collision, the client should make sure that the returned candidate data matches the request. |
I already approved. all good here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't approve the feature not the schema file changes but the code is ok. And, on a side note, this introduce the first sql statement in the api module.
Good enough for me! |
This adds the ability to use PSCID instead of CandID in the URL for
the v0.0.4-dev version of the API. All endpoints under /candidates/{candID} should now accept /candidates/{PSCID} instead, as long as there's one single unique PSCID with that identifier.
This was requested by the HBCD project, but after talking to @ridz1208 is a common request for many projects, so I've added the functionality to v0.0.4-dev of the API.