Repository navigation
Conversation
The filename parser stores a version tag such as `(v2.00)` or `(version CN-07)` in `Rom.version` and keeps it out of `tags`, but the ROM response schemas never exposed it, so a client had no way to read it. Add `version` next to `revision` and regenerate the frontend types. Closes rommapp#5243
[Medium impact] Adds a parsed version field to ROM API responses. Add the missing fixture default before merging so the frontend typecheck passes.
|
| is_unidentified: boolean; | ||
| is_identified: boolean; | ||
| revision: (string | null); | ||
| version: (string | null); |
There was a problem hiding this comment.
Adding required version breaks romFixture() in frontend/src/utils/rom.fixtures.ts. It returns SimpleRom, which aliases SimpleRomSchema, but never supplies version. The trailing Partial<SimpleRom> spread cannot guarantee that field, so npm run typecheck fails. Add version: null to the fixture defaults.
Prompt To Fix With AI
This is a comment left during a code review.
Path: frontend/src/__generated__/models/SimpleRomSchema.ts
Line: 85
Comment:
**Frontend typecheck fails**
Adding required `version` breaks `romFixture()` in `frontend/src/utils/rom.fixtures.ts`. It returns `SimpleRom`, which aliases `SimpleRomSchema`, but never supplies `version`. The trailing `Partial<SimpleRom>` spread cannot guarantee that field, so `npm run typecheck` fails. Add `version: null` to the fixture defaults.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in c1ea5ca: romFixture() in rom.fixtures.ts now supplies version: null, and so do the other two hand-built ROM objects (listRowFixture.ts and RelatedGameCard.vue).
romFixture(), the list row fixture and RelatedGameCard build SimpleRom objects by hand, so vue-tsc rejected them once version became a required schema field.
Description
Closes #5243.
The filename parser already pulls a version tag such as
(v2.00)or(version CN-07)intoRom.versionand keeps it out oftags, butRomSchemanever exposed it, so API clients couldn't tell two copies apart when they differ only by version. This addsversion: str | Nonenext torevision, so it shows up in bothSimpleRomSchemaandDetailedRomSchema.The two changed files under
frontend/src/__generated__/are exactly whatnpm run generate(openapi-typescript-codegen 0.29.0, same flags) produces from the patched backend'stools.dump_openapioutput, so the API types check should stay green.romFixture(), the list row fixture andRelatedGameCardbuildSimpleRomobjects by hand, so they getversion: nulltoo (thanks to the review bot for catching that).I left the docs mention the issue suggests for the docs repo.
Checklist
Tests
test_rom_responses_include_the_parsed_version_tagrenames a ROM toHelmet (version CN-07).nesand checks thatversioncomes back asCN-07from the update, the detailed and the simple endpoints, withtagsempty. It fails onmasterwithKeyError: 'version'.AI assistance
I used Claude Code to trace the parser and schema, write the change and the test, and run the checks above. I read the diff and the test results before opening this.