Skip to content

Example apps' document forms send a "$ref" property as a string, whatever type it resolves to #6185

Backlog

Description

@QuantumExplorer

The schema-driven document form in both example apps chooses each editor and JSON value from the property's inline type:

  • SwiftExampleApp: DocumentFieldsView and CreateDocumentView.propertiesJSON.
  • KotlinExampleApp: DocumentPropertyField and buildPropertiesJson in CreateDocumentScreen.kt.

A property declared with "$ref": "#/$defs/<name>" has no inline type, so it gets the plain text editor and goes out as a JSON string. If the definition is an integer, number or boolean, typing 7 sends "7". DPP resolves the reference, its sanitizer does not convert text to an integer, and Rust refuses the document. Such a document cannot be created from the form.

Where this shows up:

Fix: the apps should not get a second schema resolver. Rust should hand the form each property's resolved type (for example a projection beside propertyConstraints), or the form should offer a raw properties JSON input that keeps value types.

Found in review of #6169 (thepastaclaw).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions