Add new form element schemas for enhanced functionality#63
Conversation
There was a problem hiding this comment.
Pull request overview
This PR substantially expands the OpenAPI schemas for Forms by introducing dedicated component schemas for individual form element types (and related helper objects), with the goal of improving API contract clarity around form configuration.
Changes:
- Added schema components for form elements (e.g., TextField, ChoiceField, Repeatable, Section) plus shared helper types (conditions, choices, classification sets).
- Introduced
FormElementas a polymorphiconeOfto model theelementsarray, and addedFormBodyto describe theformpayload. - Updated
FormRequestto reference the newFormBodyschema.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "value": { | ||
| "type": "string", | ||
| "description": "The value to compare against (may be null for is_empty/is_not_empty operators)", | ||
| "nullable": true | ||
| } |
| "label": { | ||
| "type": "string", | ||
| "description": "Display label for the field", | ||
| "nullable": true | ||
| }, |
| "choices": { | ||
| "type": "array", | ||
| "description": "List of selectable options", | ||
| "items": { | ||
| "$ref": "#/components/schemas/FormElementChoice" | ||
| } | ||
| }, | ||
| "choice_list_id": { | ||
| "type": "string", | ||
| "description": "ID of a shared Choice List resource to use instead of inline choices", | ||
| "nullable": true | ||
| }, |
| { "$ref": "#/components/schemas/FormClassificationSetSchema" } | ||
| ] | ||
| } | ||
| } |
| { "$ref": "#/components/schemas/FormLabelElement" } | ||
| ], | ||
| "discriminator": { | ||
| "propertyName": "type" |
|
@copilot resolve the merge conflicts in this pull request |
…rm schemas - Merge origin/v2 into spike/create-form-types - Resolve rest-api.json conflicts by incorporating all new v2 schemas (Photo, Audio, Video, Signature, Sketch, Attachment, StatusField, etc.) alongside our new form element schemas - Address reviewer feedback: * Replace nullable:true with JSON Schema 3.1 union types (type: [x, null]) * Make label required in FormBaseElement * Add anyOf constraint to FormChoiceFieldElement (choices or choice_list_id required) * Add anyOf constraint to FormClassificationFieldElement (classification_set_id or classification_set_schema required) * Add discriminator mapping to FormElement for OpenAPI tooling compatibility Co-authored-by: treyhyde <62077+treyhyde@users.noreply.github.com>
…s.md Agent-Logs-Url: https://github.com/fulcrumapp/api/sessions/ae575ad9-4dd6-45cd-9593-34dc9cd7c43a Co-authored-by: treyhyde <62077+treyhyde@users.noreply.github.com>
Resolved in e8c9ca9. Merged
|
pedrodotavila
left a comment
There was a problem hiding this comment.
Automated review: Large OpenAPI schema expansion adding dedicated component schemas for all form element types. Two suggestions:
- Merge PR #64 first — it adds the validation workflow that would catch spec issues in this PR. Without it, there's no automated guarantee the expanded spec validates correctly.
- Copilot-resolved merge conflicts should be spot-checked — the bot resolved conflicts while also making changes (replacing
nullable: truewith JSON Schema 3.1 union types, adding discriminator mapping). Manual verification recommended.
Introduce new form element schemas to improve form capabilities and user experience.