From 82baf4910e0abb0408254110f6e75c6f52d9bffe Mon Sep 17 00:00:00 2001 From: Natalie Rose Date: Fri, 28 Aug 2026 13:50:39 +1000 Subject: [PATCH] building_resources: don't require ore_hour / ore_capacity They are omitted for the Mining Ministry (its ore output comes from mining platforms, not the building), so building_resources can no longer reuse building_production's required list wholesale. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01YHFW115mcUcTgqULWKBKbh --- src/spec/components.ts | 60 +++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/src/spec/components.ts b/src/spec/components.ts index d8052fa..713c573 100644 --- a/src/spec/components.ts +++ b/src/spec/components.ts @@ -288,28 +288,50 @@ export const components = { }, // A single building's contribution to the planet economy, as returned by - // get_buildings_resources: the aggregate `building_production` fields plus a - // per-food-type and per-ore-type production breakdown. `food` is present only - // when the building produces food, `ore` only when it produces ore (Perl omits - // an empty map entirely) — hence neither is required. + // get_buildings_resources: the same aggregate figures as `building_production` + // plus a per-food-type and per-ore-type production breakdown. + // - `food` is present only when the building produces food, `ore` only when + // it produces ore (Perl omits an empty map entirely). + // - `ore_hour` / `ore_capacity` / `ore` are ALL omitted for the Mining + // Ministry, whose ore output is driven by its deployed mining platforms + // rather than the building itself - hence they are not required here even + // though `building_production` requires ore_hour / ore_capacity. building_resources: { - allOf: [ - { $ref: '#/components/schemas/building_production' }, - { + type: 'object', + properties: { + food_hour: { type: 'integer' }, + food_capacity: { type: 'integer' }, + energy_hour: { type: 'integer' }, + energy_capacity: { type: 'integer' }, + water_hour: { type: 'integer' }, + water_capacity: { type: 'integer' }, + waste_hour: { type: 'integer' }, + waste_capacity: { type: 'integer' }, + happiness_hour: { type: 'integer' }, + // Omitted for the Mining Ministry (see above). + ore_hour: { type: 'integer' }, + ore_capacity: { type: 'integer' }, + food: { type: 'object', - properties: { - food: { - type: 'object', - description: 'Hourly production keyed by food type.', - additionalProperties: { type: 'integer' }, - }, - ore: { - type: 'object', - description: 'Hourly production keyed by ore type.', - additionalProperties: { type: 'integer' }, - }, - }, + description: 'Hourly production keyed by food type.', + additionalProperties: { type: 'integer' }, + }, + ore: { + type: 'object', + description: 'Hourly production keyed by ore type.', + additionalProperties: { type: 'integer' }, }, + }, + required: [ + 'food_hour', + 'food_capacity', + 'energy_hour', + 'energy_capacity', + 'water_hour', + 'water_capacity', + 'waste_hour', + 'waste_capacity', + 'happiness_hour', ], }, -- 2.51.2