Skip to content

Schema: models + GET/PUT /api/lists/{id}/schema service #17

Description

@Adron

Scope

Model the DSL and add both schema calls to Services/InterlinedApiClient.Lists.cs.

Models (InterlinedList/Models/)

  • ListSchema — Name (required), Description, Fields (>= 1).
  • ListField — Key, Type, Label (required) + Required, DefaultValue, Options, Placeholder, HelpText, Validation, Visible, Visibility, DisplayOrder.
  • ListFieldValidation — Min, Max, MinLength, MaxLength, Pattern, Step.
  • ListFieldVisibility — Condition { Field, Operator, Value }.
  • ListFieldType — the twelve types as a constrained set: text, textarea, number, boolean, date, datetime, email, url, tel, select, multiselect, priority.

Note the wire mapping: each fields[] entry is stored as a ListProperty (key→propertyKey, label→propertyName, type→propertyType) — the properties body shape uses those names.

Service

  • GetListSchemaAsync(listId) → GET, response is wrapped: {"data": {...}}.
  • PutListSchemaDslAsync(listId, ListSchema) → destructive rebuild.
  • PutListPropertiesAsync(listId, properties) → non-destructive edits.
  • CreateListAsync gains an optional schema argument.

Error handling

400 responses name the offending column, e.g.
Invalid schema: Field 'year' has invalid type 'integer'. Valid types: text, number, ...
Surface that message against the field, not as a generic failure. Also handle: missing name, empty fields, a field missing key/type/label, select/multiselect without options, duplicate keys.

Acceptance criteria

  • All four service methods land, shapes verified live against the test account.
  • ListSummary keeps compiling; schema is fetched separately, not folded into it.
  • A round-trip test (read schema → PUT it back unchanged) is verified on a throwaway test list.

Activity

  1. added
    parityWeb/API feature-parity work
    P0Must have for a credible parity claim
    on Sep 15, 2026
  2. Adron commented on Sep 16, 2026

    @Adron
    MemberAuthor

    Implemented in #143 — work continues in the PR from here.

    Three surprises worth carrying into #18-#22. First, the non-destructive properties form accepts only six propertyTypes (text, number, boolean, date, url, email) and propertyType is mandatory on every item, so a list using any of the other six DSL types can't be re-shaped non-destructively at all — ListSchema.SupportsPropertiesEdit exposes that so the UI can route around it. Second, "destructive" turns out to mean columns, not rows: the DSL rebuild drops and recreates every column with a new id and overwrites the list title and description (clearing the description when omitted), but the rows survive with values for removed keys orphaned in rowData — so #22's confirmation copy should say that, not "rows will be deleted". Third, deleting a data-bearing column via properties is refused with a 409 carrying propertiesWithData: [...] until you re-send with ?force=true (which strips the key from every row); the shared EnsureSuccessAsync would have thrown that array away, hence the dedicated ListSchemaException.

    Confirmed on throwaway lists (all deleted): properties preserves rows byte-for-byte, and schema.name does overwrite the list title. Also: /help/api/lists still documents the DSL as a string — that form is rejected, object only.

  3. added a commit that references this issue on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Must have for a credible parity claimarea:listsArea: listsparityWeb/API feature-parity work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions