daw_field_type/v1: define the form of collection.values entries (label with resource_id) #17
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type/design
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-contracts#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
In
daw_field_type/v1,collection.values(forsource = static) isonly "an array": the element type is not defined. A receiver cannot know
how to read an entry, and an entry cannot carry a translatable label.
Without a label, an adapter can only show the raw value (for example
yes), untranslated. The same problem is already solved elsewhere:daw_error/v1anddaw_event/v1carry a canonical Englishmessageand an optional
resource_id(daw_i18n/v1).First use case: a yes/no confirmation declared as
selection/static/singlewith two answers, shown by cli, web, desktop and api alike.Proposal
Each entry of
collection.valuesis either(existing examples stay valid), or
{ "value": ..., "message": ..., "resource_id": ... }:valueis the language-neutral value returned in the answer,messagethe canonical English display text,resource_idoptionaland only valid together with
message, resolved like indaw_error/v1; if it cannot be resolved the adapter falls back tomessageThis is a new optional form inside
v1(see "Growth within a version" inTEMPLATE.md): objects that use strings stay valid.
Open questions
entries of one array use the same form)
message: none in v1 (static labels carry nodata)daw_event_response/v1, andwhere the declared field is placed in
daw_event/v1(provisionallydata.value/data.answer, see the berhtjan-core companion issue);separate issue after the first validation
Acceptance criteria
message,resource_idwithoutmessage, mixed array)daw_error/v1patternRelated
DAW/daw-modul-berhtjan-core, DAW/daw-modul-berhtjan-cli#14,
DAW/fragjan#137, DAW/daw-contracts#2
Cross references
Part of one first validation (yes/no confirmation before a module is
removed), together with:
Both use the object form of
collection.valuesprovisionally, markedas such, until this issue is decided.