Skip to content

Business Schema: Update to Enforce Non-empty Required String Fields #32771

Closed
6 of 6 issues completed
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.

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"]
}

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

Please also clean-up the legal-api validation to remove any deprecated code after the schema changes are made.

Sub-issues

Sub-issues

6 of 6 Issues completed
Loading 6 sub-issues

Activity

  1. added
    Entities Team
    on Mar 10, 2026
  2. self-assigned this
    on Jun 11, 2026
  3. self-assigned this
    on Jun 25, 2026
  4. mruff-aeq commented on Jun 30, 2026

    @mruff-aeq
    Collaborator

    @gunanagar @rsagpariya , what you need to do to test the UI wont cause issue

    A. Create UI - business-create-ui

    SchemaField under testFiling(s)How to trigger
    addressstreetAddress, addressCity, addressCountryIA, registration, continuationIn, amalgamation, restorationRegistered/Records office + party/director address steps
    contact_pointemailIA, registration, continuationInBusiness contact email step
    partyofficer - lastName / organizationNameIA, registration, amalgamationAdd People and Roles step
    directorsperson - firstName, lastNameIA (directors)Add People and Roles (director)
    share_structureshareClass - name, shareSeries - nameIA, amalgamation, continuationInCreate Share Structure step
    name_translationsnameIA, alteration, continuationIn, amalgamationName Translations step
    cooperativerulesFileKey, memorandumFileKeyIA (CP / co-op only)Co-op IA - Upload Rules/Memorandum
    amalgamation_applicationamalgamatingBusiness - identifier, legalNameamalgamationApplicationAmalgamating Businesses step
    continuation_inforeignJurisdiction - identifier, legalName; authorization - files - fileKey, fileNamecontinuationInForeign jurisdiction + authorization proof upload
    foreignJurisdictioncountrycontinuationInForeign jurisdiction picker
    filingheader - certifiedByallCertify step

    B. Edit UI - business-edit-ui

    SchemaField under testFiling(s)How to trigger
    correctioncorrection - commentcorrectionCorrection filing - detail/comment
    partyofficer - lastName / organizationNamechangeOfRegistration, correction, conversionPeople and Roles
    addressstreetAddress, addressCity, addressCountrychangeOfRegistration, correction, conversionOffice/party addresses
    name_translationsnamealterationAlter - name translations
    share_structurename (class/series)alteration, correctionAlter - share structure
    contact_pointemailchangeOfRegistrationContact info
    filingcertifiedByallCertify step

    C. Filings UI (staff/maintenance) - business-filings-ui

    SchemaField under testFilingHow to trigger
    directorsperson firstName/lastName + the mailingAddress gapchangeOfDirectorsDashboard - Change of Directors (scenario 4 / backlog ticket lives here)
    addressstreet/city/countrychangeOfAddressChange of Address
    agm_extensionyearagmExtensionStaff menu - AGM Extension
    agm_location_changeyear, reason, agmLocationagmLocationChangeStaff menu - AGM Location Change
    amalgamation_outdetails, legalNameamalgamationOutStaff menu - Amalgamation Out
    continuation_outlegalNamecontinuationOutStaff menu - Continuation Out
    foreignJurisdictioncountryconsentContinuationOut, consentAmalgamationOut, continuationOutForeign jurisdiction on those filings
    registrars_notationorderDetails (currently minLength=1, needs pattern)registrarsNotationStaff menu - Registrar's Notation
    registrars_orderorderDetails (needs pattern)registrarsOrderStaff menu - Registrar's Order

    D. Dashboard / other

    SchemaFieldWhereHow
    commentcomment - commentstaff commentbusiness-dashboard-ui - add a staff comment on a business/filing
  5. gunanagar commented on Jun 30, 2026

    @gunanagar
    Collaborator

    #34030 - registrars_order
    #34029 - registrars_notation
    #33966 - Continutation In

  6. gunanagar commented on Jul 3, 2026

    @gunanagar
    Collaborator

    Tested looks good.

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

Metadata

Metadata

Labels

Entities Team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions