Skip to content

fix(data): enforce canonical city slugs - #211

Merged
yakew7 merged 1 commit into
StudentSuite:mainfrom
AyobamiH:fix/160-city-slug-validation
Sep 6, 2026
Merged

fix(data): enforce canonical city slugs#211
yakew7 merged 1 commit into
StudentSuite:mainfrom
AyobamiH:fix/160-city-slug-validation

Conversation

@AyobamiH

@AyobamiH AyobamiH commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Problem

Closes #160.

City values are documented as lowercase, underscore-separated slugs, but the dataset contained four values outside that shape and one misspelling. The validator did not enforce the convention.

Changes

  • Define the canonical city slug pattern in data/places.schema.json.
  • Have validate-places.mjs enforce that schema-owned pattern.
  • Normalize the Xiamen and New Delhi records and correct the Philadelphia spelling.
  • Correct the API documentation example to show the canonical new_delhi slug.

Verification

  • npm run validate
  • npm run lint
  • npm run typecheck
  • npm run test:unit (42 files, 377 tests)
  • env -u NEXT_PUBLIC_MAPTILER_KEY npm run build (594 pages)
  • npx prettier --check data/places.schema.json data/places/library.json data/places/sat_centre.json scripts/validate-places.mjs
  • Negative validation probe confirms that an invalid value such as New Delhi is rejected.
  • Local route checks:
    • /city/xiamen, /city/new_delhi, and /city/philadelphia return 200.
    • The previous malformed or misspelled routes return 404.

Known upstream check

The new full-repository npm run format:check command currently reports 127 pre-existing files on the unchanged upstream baseline. This PR does not include unrelated repository-wide formatting.

@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

@AyobamiH is attempting to deploy a commit to the studentsuite Team on Vercel.

A member of the Team first needs to authorize it.

@AyobamiH
AyobamiH force-pushed the fix/160-city-slug-validation branch from d5e8615 to 2f7bd65 Compare September 6, 2026 00:20
@yakew7
yakew7 merged commit fca57fe into StudentSuite:main Sep 6, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data: city-slug convention violations in the dataset ("厦门", "new delhi", "philadephia") + validator doesn't enforce slugs

2 participants