Skip to content

Schema Analysis: Update to Enforce Non-empty Required String Fields #31787

Closed

Description

@meawong

Background:
Our JSON schemas currently allow empty strings ("") for required string fields. This causes invalid or incomplete data to be submitted without being caught by schema validation.

Proposal:
Add a pattern validation to all required string fields across schemas to ensure each required field contains at least one non-whitespace character.

Ex.
{
"type": "object",
"properties": {
"fieldName": {
"type": "string",
"pattern": "^\S.*$" }
},
"required": ["fieldName"]
}

Note: Need to check with data migration to see if there is any impact (ex. delivery/mailing address required fields)

Activity

  1. added
    Entities Team
    on Dec 22, 2025
  2. vikas-gov commented on Feb 19, 2026

    @vikas-gov
    Collaborator

    @argush3 , pls if you can review this ticket and share any concerns implementing this wrt dm

  3. changed the title [-]Schema: Update to Enforce Non-empty Required String Fields[/-] [+]Schema Analysis: Update to Enforce Non-empty Required String Fields[/+] on Mar 4, 2026
  4. meawong commented on Mar 5, 2026

    @meawong
    CollaboratorAuthor
    Schema Required / Conditionally Required String Fields Notes / Observations
    address streetAddress, addressCity, addressCountry Top-level address fields
    agm_extension agmExtension → year Single-year field
    agm_location_change agmLocationChange → year, reason, agmLocation All fields required
    amalgamation_application amalgamationApplication → amalgamatingBusiness → identifier, legalName Nested inside amalgamatingBusiness
    amalgamation_out amalgamationOut → details, legalName
    business_document entityAct, entityDescription, registrarInfo → name Nested registrarInfo object
    comment comment → comment → comment Required string inside comment object
    contact_point contactPoint → email Required email field
    continuation_in continuationIn → foreignJurisdiction → identifier, legalName; continuationIn → authorization → files → fileKey, filename Multiple nested arrays/objects
    continuation_out continuationOut → legalName
    cooperative rulesFileKey, memorandumFileKey Top-level fields
    correction correction → comment → comment Required string inside correction object
    diff diff → items → path Nested array items
    directors person → firstName, lastName Nested person object
    filing filing_header → certifiedBy
    foreignJurisdiction country Required string
    name_translations name Already has pattern but whitespace-only not prevented
    party parties → officer → lastName, organizationName Nested arrays/objects
    registrars_notation registrarsNotation → orderDetails minLength=1 currently; needs pattern
    registrars_order registrarsOrder → orderDetails minLength=1 currently; needs pattern
    share_structure shareClasses → shareClass → name, series → shareSeries → name Deeply nested array objects
    transparency_register transparencyRegister → ledgerReferenceNumber Required top-level string
    unmanaged unmanaged → displayName Top-level string

    Summary

    • Schemas affected: 22
    • Fields affected: 36 required or conditionally required string fields
  5. meawong commented on Mar 10, 2026

    @meawong
    CollaboratorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Entities Team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions