Skip to content

Name inspection answers for what they are, and show what they answer with - #62

Merged
roncodes merged 1 commit into
mainfrom
work/inspection-answers-rename
Sep 14, 2026
Merged

Name inspection answers for what they are, and show what they answer with#62
roncodes merged 1 commit into
mainfrom
work/inspection-answers-rename

Conversation

@roncodes

Copy link
Copy Markdown
Member

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 has fields, so a submission has answers to them, and each answer names the field it 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_type goes 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_values is still accepted on submit, so nothing that already integrates breaks.

The params gap

Submit an Inspection.params.yaml documented only the first cut's flat item_results body and marked it required, contradicting both the request's own description and its pre-request script. The answers body is documented now, with its field, value and optional value_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:

  • an answer names its field by public id (custom_field_9f61c8b7a6), not a uuid;
  • item_results[].photos are resolved to { id, url, filename, content_type } rather than the file:<uuid> references they are stored as.

Note on the base

Branched from feat/driver-inspections, which is merged and now adds nothing over main, so this is rebased onto main. That deliberately keeps #61's options: { raw: { language: "json" } } fix and its Content-Type upsert — rebasing rather than merging avoids reverting them.

node scripts/validate-collections.js passes: 5 collections, 3 environments.

…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.
@roncodes
roncodes merged commit 69b9532 into main Sep 14, 2026
1 check passed
@roncodes
roncodes deleted the work/inspection-answers-rename branch September 14, 2026 07:27
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.

1 participant