90: make enketoId and name optional in the Form model#91
Merged
lognaturel merged 1 commit intogetodk:masterfrom Jul 16, 2024
Merged
90: make enketoId and name optional in the Form model#91lognaturel merged 1 commit intogetodk:masterfrom
lognaturel merged 1 commit intogetodk:masterfrom
Conversation
Member
Thanks, I've filed an issue at getodk/docs#1836, consider taking it on if you would find it helpful to have sooner than later! The conversion is done by https://github.com/getodk/docs/tree/master/extensions/openapi |
lognaturel
approved these changes
Jul 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #90
What has been done to verify that this works as intended?
Updated test fixture data to include a form where these fields are null, and ran the test suite.
Why is this the best possible solution? Were any other approaches considered?
I think I had made
nameandenketoIdrequired since every request I made during testing had those fields.I read the current Central code that seems to return this data. Per Line 79: nullable
enketoId, and Line 117: nullablename. From what I can tell, Line 50 is saying that both fields are always part of the returned object, whether null or not. According to the forum thread linked in #90, and the Central docs, it's possible to use Central without Enketo and in that caseenketoIdmay be blank. I assumed everyone used them together but apparently not. About thename, Central parses that out of the XForm title. According to the XHTML spec, ahead/titleis required but I'm not certain if it has to be non-blank. Also, pyxform tries to make sure a title is set, at least "data". In any case the XForm may be invalid somehow i.e. no title or blank. Since the above Central is willing to return a nullablename, presumably that is tolerable.I think the Central API docs on Apiary used to say which fields were required or optional, but now it's only visible in the source yaml file, not the published page.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Unblocks users of pyodk + Central but with no Enketo.
Do we need any specific form for testing your changes? If so, please attach one.
No
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No
Before submitting this PR, please make sure you have:
testspython -m unittestand verified all tests passruff format pyodk testsandruff check pyodk teststo lint code