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

feat: add presetRef to observation #207

Merged
merged 3 commits into from
Aug 5, 2024

Conversation

tomasciccola
Copy link
Contributor

should close #205. I put it as required on JSONSchema and non-optional on the proto definition

Copy link
Member

@gmaclennan gmaclennan left a comment

Choose a reason for hiding this comment

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

I think we should leave presetRef as optional. I think there are cases where it might not make sense to populate this value (an observation could be created without a preset - it is in tests).

I think for Protobuf sub-messages, the difference between marking it as optional or not is in the generated code and resulting types either being { presetRef?: PresetRef | undefined } or { presetRef: PresetRef | undefined }. I think the former is preferable, to avoid the API consumer needing to always specify it as a property, even if undefined. So maybe add optional to the proto def too.

Can you ensure test fixtures include docs both with and without the presetRef set.

Copy link
Member

@gmaclennan gmaclennan left a comment

Choose a reason for hiding this comment

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

one small fix needed, once done go ahead and merge.

src/lib/encode-conversions.ts Outdated Show resolved Hide resolved
Co-authored-by: Gregor MacLennan <gmaclennan@digital-democracy.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add presetRef: { docId, versionId } to observation schema.
2 participants