Urban-Analytics-Technology-Platform / popgetter-cli

A rust library and CLI for accessing popgetter data
0 stars 0 forks source link

Explicitly version schema #12

Closed yongrenjie closed 2 months ago

yongrenjie commented 2 months ago

Still not sure about

const POPGETTER_SUPPORTED_VERSION: &str = "0.1.0"

and then import the metadata like

import_types!(concat!("schema/popgetter_", POPGETTER_SUPPORTED_VERSION, ".json"));

but macro-in-macro doesn't work because import_types! only accepts a single string literal (as far as I can tell)

It would then also be good to have a test to read in the JSON and check that the version field is indeed equal to POPGETTER_SUPPORTED_VERSION, because typify doesn't give us access to properties apart from the type definitions.

To try to minimise the chances of inconsistencies here...

I've changed the popgetter-export-schema upstream command to always use its __version__ (see https://github.com/Urban-Analytics-Technology-Platform/popgetter/pull/80)

and also documented it in this repo's README.

yongrenjie commented 2 months ago

^ Rebased off main.