Name inspection answers for what they are, and show what they answer with - #62
Merged
Conversation
…with The API called a submission's answers `custom_field_values`, which names the table they are stored in rather than what they are. A form has `fields`, so a submission has `answers` to them, each naming the `field` it answers by the same id the form read handed out. `value_type` goes with it: it says how a value is stored, which is not an integrator's business — `type`, the field's own type, is what says how to read a value. The old spelling is still accepted on submit. Submit an Inspection documented only the first cut's flat `item_results` body, and marked it required, which contradicted both its own description and its pre-request script. The answers body is documented now, and neither is required on its own. None of the six inspection requests had a saved response example, so the reference showed no shape at all. Each has one now, including the 422 a form raises when a failed check is filed without the comment or photo the field insists on.
This was referenced Sep 14, 2026
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.
Follows the API change in fleetops#319.
The naming
A submission's answers were documented as
custom_field_values, which names the table they are stored in rather than what they are. A form hasfields, so a submission hasanswersto them, and each answer names thefieldit answers — by the same id the form read handed out, so the id a consumer reads, submits with, and reads back are one id.value_typegoes with it. It says how a value is stored, which is not an integrator's concern;type— the field's own type — is what says how to read a value. Both stay on the console's internal namespace.custom_field_valuesis still accepted on submit, so nothing that already integrates breaks.The params gap
Submit an Inspection.params.yamldocumented only the first cut's flatitem_resultsbody and marked it required, contradicting both the request's own description and its pre-request script. The answers body is documented now, with itsfield,valueand optionalvalue_type, and neither body is required on its own.Response examples
None of the six inspection requests had a saved example, so the reference showed no response shape at all. Each has one now, plus the 422 a form raises when a failed check is filed without the comment or photo the field insists on.
Two shapes in those examples are worth calling out, because both changed in fleetops#319 to stop leaking internal identifiers:
custom_field_9f61c8b7a6), not a uuid;item_results[].photosare resolved to{ id, url, filename, content_type }rather than thefile:<uuid>references they are stored as.Note on the base
Branched from
feat/driver-inspections, which is merged and now adds nothing overmain, so this is rebased ontomain. That deliberately keeps #61'soptions: { raw: { language: "json" } }fix and itsContent-Typeupsert — rebasing rather than merging avoids reverting them.node scripts/validate-collections.jspasses: 5 collections, 3 environments.