Skip to content
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

[api] Modify YAML schema so that Swagger Codegen PHP Client works #7857

Merged
merged 2 commits into from
Mar 14, 2023

Conversation

zaliqarosli
Copy link
Contributor

@zaliqarosli zaliqarosli commented Nov 29, 2021

Brief summary of changes

  • Have you updated related documentation?

This PR:

Fixes:

  • remove '#/components/schemas/InstrumentData' because the Data object does not have any explicitly defined properties
  • fixes the schema where things are incorrectly defined
  • adds 'Other' Sex option now available on LORIS core

Changes:

  • modifies $InstrumentShortName key in Instrument API to 'Data' so that the key is static (i don't think there's a need for it to be dynamic depending on the instrument - the key is just the instrument instance data)

Testing instructions (if applicable)

Link(s) to related issue(s)

  • Resolves # (Reference the issue this fixes, if any.)

@xlecours
Copy link
Contributor

xlecours commented Nov 30, 2021

@zaliqarosli Fixes should changes schema.yml but other changes needs to go in schema-v0.0.4-dev.yml (e.g.: $intrumentname --> Data)

@ridz1208 ridz1208 added 24.0.0-bugs Issues or bug fix PRs that were raised during the testing of release 24.0.0 API PR or issue introducing/requiring modifications to the API code Critical to release PR or issue is key for the release to which it has been assigned Needs Work PR awaiting additional changes by the author or contains issues that the author needs to fix labels Jan 20, 2022
@ridz1208 ridz1208 added Discussion Required PR or issue awaiting the resolution of a discussion between all involved parties and removed Critical to release PR or issue is key for the release to which it has been assigned labels Jan 21, 2022
@zaliqarosli zaliqarosli reopened this Jan 21, 2022
@ridz1208
Copy link
Collaborator

@zaliqarosli after speaking to @driusan the only remaining issues on this PR is that the instrument.class.inc endpoint is being modified which impacts all API versions.

@xlecours could you instruct @zaliqarosli how to deal with that? I think we were creating a copy of the class and tagging it with the api version... is that it? like instrument-0.0.4.class.inc or something ?

@xlecours
Copy link
Contributor

@zaliqarosli

  1. there should be a switch on version in the endpoint handleGet function similar to https://github.com/aces/Loris/blob/main/modules/api/php/endpoints/candidate/visit/images.class.inc#L136-L149
  2. We need a new "view" class instrument_0_0_4_dev.class.inc similar to visit_0_0_4_dev.class.inc

@zaliqarosli zaliqarosli removed Needs Work PR awaiting additional changes by the author or contains issues that the author needs to fix Discussion Required PR or issue awaiting the resolution of a discussion between all involved parties labels Dec 17, 2022
modules/api/static/schema-v0.0.4-dev.yml Outdated Show resolved Hide resolved
modules/api/static/schema.yml Show resolved Hide resolved
@zaliqarosli zaliqarosli added the Needs Work PR awaiting additional changes by the author or contains issues that the author needs to fix label Dec 20, 2022
@zaliqarosli zaliqarosli reopened this Dec 21, 2022
Copy link
Contributor

@xlecours xlecours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zaliqarosli While I was trying the schema-v0.0.4-dev.yml file in swagger editor, it complained about multiple entries in the components that are defined twice. Would you mind fixing these in this PR as well?
ex: VisitStage, InstrumentVisit, ...

I'll approve the PR in its current stage anyways.
Thanks

@zaliqarosli
Copy link
Contributor Author

@xlecours i am getting these failed tests

There were 4 failures:

1) LorisApiInstrumentsTest::testPatchCandidatesCandidVisitInstrumentsInstrument
Failed asserting that 200 matches expected 204.

/app/raisinbread/test/api/LorisApiInstrumentsTest.php:120

2) LorisApiInstrumentsTest::testPutCandidatesCandidVisitInstrumentsInstrument
Failed asserting that 200 matches expected 204.

/app/raisinbread/test/api/LorisApiInstrumentsTest.php:147

3) LorisApiInstrumentsTest::testPatchCandidatesCandidVisitInstrumentsInstrumentDde
Failed asserting that 200 matches expected 204.

/app/raisinbread/test/api/LorisApiInstrumentsTest.php:370

4) LorisApiInstrumentsTest::testPutCandidatesCandidVisitInstrumentsInstrumentDde
Failed asserting that 200 matches expected 204.

/app/raisinbread/test/api/LorisApiInstrumentsTest.php:403

which I don't understand as the instrument endpoint is clearly returning 204 No Content, and I'm not sure where the 200 is coming from. do you have any ideas?

@zaliqarosli zaliqarosli removed the Needs Work PR awaiting additional changes by the author or contains issues that the author needs to fix label Dec 22, 2022
@zaliqarosli zaliqarosli reopened this Jan 12, 2023
add other sex option

add Meta property to visitmeta

redo

remove dynamic key

instrumentData is empty class if no properties set

change other instances of $instrumentname

move to v0.0.04

add Other sex to docs

phan

add switch for versions

cleanup + add more version checks

fixes

add to v4

fix return with 204

add missing ;

remove duplicated

fix schema

fix test for v0.0.0-4
@zaliqarosli
Copy link
Contributor Author

@ridz1208 @driusan @xlecours can/should this go to the release branch?

@xlecours
Copy link
Contributor

xlecours commented Mar 6, 2023

@ridz1208 Do you mean 24.1 or the next release?
Adding specification for Other Sex value is a documentation fix that could be applied to 24.1 but changing the variable property name to fixed Data is a new feature.

@ridz1208
Copy link
Collaborator

ridz1208 commented Mar 6, 2023

I agree with @xlecours but isnt that the reason the API is versioned separately than LORIS? as long as its going to 0.0.4-dev it should be fine if it goes in 24.1 as far as I understand

@driusan
Copy link
Collaborator

driusan commented Mar 6, 2023

@ridz1208 yes but this PR is changing 0.0.3

@driusan
Copy link
Collaborator

driusan commented Mar 6, 2023

nm, just saw that it's only the "other" part going to 0.0.3.

@laemtl laemtl added this to the 25.0.0 milestone Mar 14, 2023
@laemtl laemtl assigned driusan and unassigned zaliqarosli Mar 14, 2023
@driusan driusan merged commit c731d2e into aces:main Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
24.0.0-bugs Issues or bug fix PRs that were raised during the testing of release 24.0.0 API PR or issue introducing/requiring modifications to the API code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants