Field-type identification
Summary
Identify and classify fields in JSON project documents according to their designated types (e.g., URL, string, number) as defined in a JSON schema, enabling downstream validation and processing rules specific to each field category.
When to use
When working with JSON project documents that must conform to a schema-defined structure, and you need to apply type-specific validation, sanitization, or transformation rules (e.g., URL whitespace detection, numeric range checking, mandatory field enforcement).
When NOT to use
- Input is a non-JSON or unstructured document (e.g., CSV, plain text)
- The project JSON does not declare which schema version it conforms to
- No schema file is available or schema is incomplete/malformed
Inputs
- Project JSON document
- JSON schema definition file (app/public/schema.json)
Outputs
- Field-type mapping (field name → type classification)
- Categorized field list (URLs, strings, numbers, etc.)
- Validation rule assignments per field type
How to apply
Load the project JSON schema (e.g., app/public/schema.json) and parse its field type definitions. Iterate through each field in a project JSON document and cross-reference its name against the schema to determine its declared type. For fields with URL type, flag them for URL-specific validation (whitespace detection); for string fields, apply text constraints; for numeric fields, apply range checks. This classification step is prerequisite to any schema-aware validation workflow and ensures validation rules are applied only to relevant field categories.
Related tools
Evaluation signals
- All fields in the project JSON are successfully mapped to a type declared in the schema
- Fields classified as URL type match the schema's URL field list (e.g., project URLs, reference links, data repository links)
- No fields are left unclassified or assigned an unknown type
- Type-specific validation rules (e.g., whitespace checks for URLs) can be applied to the correct field subset
- Schema conformance check passes without type mismatch errors
Limitations
- Requires the schema file to be present and valid; breaks silently if schema is missing or malformed
- Does not validate field values themselves, only identifies their types; whitespace or format errors are caught by downstream validation, not this step
- Schema version mismatch between document and schema definition may lead to incorrect type assignments
- Platform historically had issues with spaces in URLs not being properly handled, suggesting field-type identification alone is insufficient without downstream whitespace validation
Evidence
- [other] The platform stores paired omics data projects using a JSON schema format (app/public/schema.json) that defines project structure: "The platform stores paired omics data projects using a JSON schema format (app/public/schema.json) that defines project structure, which serves as the basis for implementing field-level validation"
- [other] Identify all fields designated as URL type in the schema (e.g., project URLs, reference links, data repository links): "Identify all fields designated as URL type in the schema (e.g., project URLs, reference links, data repository links). Iterate through each URL field and check for the presence of whitespace"
- [readme] The JSON schema (app/public/schema.json) describes the format of an project: "The JSON schema (app/public/schema.json) describes the format of an project."
- [discussion] Warning to not include spaces in urls: "Spaces in URLs not properly handled [section=discussion; evidence='Warning to not include spaces in urls ([#75]'"
1---2name: field-type-identification3description: Use when when working with JSON project documents that must conform to a schema-defined structure, and you need to apply type-specific validation, sanitization, or transformation rules (e.g., URL whitespace detection, numeric range checking, mandatory field enforcement).4license: CC-BY-4.05---67# Field-type identification89## Summary1011Identify and classify fields in JSON project documents according to their designated types (e.g., URL, string, number) as defined in a JSON schema, enabling downstream validation and processing rules specific to each field category.1213## When to use1415When working with JSON project documents that must conform to a schema-defined structure, and you need to apply type-specific validation, sanitization, or transformation rules (e.g., URL whitespace detection, numeric range checking, mandatory field enforcement).1617## When NOT to use1819- Input is a non-JSON or unstructured document (e.g., CSV, plain text)20- The project JSON does not declare which schema version it conforms to21- No schema file is available or schema is incomplete/malformed2223## Inputs2425- Project JSON document26- JSON schema definition file (app/public/schema.json)2728## Outputs2930- Field-type mapping (field name → type classification)31- Categorized field list (URLs, strings, numbers, etc.)32- Validation rule assignments per field type3334## How to apply3536Load the project JSON schema (e.g., app/public/schema.json) and parse its field type definitions. Iterate through each field in a project JSON document and cross-reference its name against the schema to determine its declared type. For fields with URL type, flag them for URL-specific validation (whitespace detection); for string fields, apply text constraints; for numeric fields, apply range checks. This classification step is prerequisite to any schema-aware validation workflow and ensures validation rules are applied only to relevant field categories.3738## Related tools3940- **npm** (Runtime environment for loading, parsing, and iterating JSON schema and project documents) — https://www.npmjs.com/41- **paired-data-form repository** (Source of the JSON schema definition and project structure documentation) — https://github.com/iomega/paired-data-form4243## Evaluation signals4445- All fields in the project JSON are successfully mapped to a type declared in the schema46- Fields classified as URL type match the schema's URL field list (e.g., project URLs, reference links, data repository links)47- No fields are left unclassified or assigned an unknown type48- Type-specific validation rules (e.g., whitespace checks for URLs) can be applied to the correct field subset49- Schema conformance check passes without type mismatch errors5051## Limitations5253- Requires the schema file to be present and valid; breaks silently if schema is missing or malformed54- Does not validate field values themselves, only identifies their types; whitespace or format errors are caught by downstream validation, not this step55- Schema version mismatch between document and schema definition may lead to incorrect type assignments56- Platform historically had issues with spaces in URLs not being properly handled, suggesting field-type identification alone is insufficient without downstream whitespace validation5758## Evidence5960- [other] The platform stores paired omics data projects using a JSON schema format (app/public/schema.json) that defines project structure: "The platform stores paired omics data projects using a JSON schema format (app/public/schema.json) that defines project structure, which serves as the basis for implementing field-level validation"61- [other] Identify all fields designated as URL type in the schema (e.g., project URLs, reference links, data repository links): "Identify all fields designated as URL type in the schema (e.g., project URLs, reference links, data repository links). Iterate through each URL field and check for the presence of whitespace"62- [readme] The JSON schema (app/public/schema.json) describes the format of an project: "The JSON schema (app/public/schema.json) describes the format of an project."63- [discussion] Warning to not include spaces in urls: "Spaces in URLs not properly handled [section=discussion; evidence='Warning to not include spaces in urls ([#75]'"