Write one sample document per resource from the service itself - #57
Merged
Conversation
A TemporalProperty document names its type with one of the five tokens the standard declares — `components/schemas/temporalProperty/properties/type` admits TBoolean, TText, TInteger, TReal and TImage — so an integer property is written TInteger and a boolean one TBoolean, where they read TInt and TBool. The token is the tier's internal name for the type as well, so the aggregation table and the window dispatch carry the same spelling and a stream query over either property resolves as before; the spellings a caller may write when storing a property are unchanged, `tint` and `tbool` among them. A test reads the admitted set out of the vendored schema and checks the token of every spelling the tier accepts, which is what the suite lacked: the plural TemporalProperties document was validated against its schema and the singular one was not.
The service writes its own sample documents: `mfapi -emit <dir>` reads every resource it serves through the routing table it serves them with, and writes each answer, so a sample states what the code answers rather than what its author believed it answers. The emitter names no collection, feature or property of its own — it reads the collections the service lists and takes the first, then that collection's features, then that feature's temporal properties — so it answers for whatever database it is pointed at. `samples/` holds the thirteen documents the conformance fixture produces, with an index naming each one, the request that produced it and the status the tier answered with; a status other than 200 is a sample too, since the tier answers 501 for an acceleration under linear interpolation. The conformance job re-emits the set and fails when a committed document is not what the service writes, normalising only the TemporalProperties `timeStamp`, which the standard defines as the moment the document was written.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mfapi -emit <dir>reads every resource the service serves, through the routing table it serves them with, and writes each answer, so a sample states what the code answers. The emitter names no collection, feature or property of its own: it reads the collections the service lists and takes the first, then that collection's features, then that feature's temporal properties, so it answers for whatever database it is pointed at.samples/holds the thirteen documents the conformance fixture produces, with an index naming each one, the request that produced it and the status the tier answered with. A status other than 200 is a sample too: the tier answers 501 for an acceleration under linear interpolation, since a speed that is constant on every segment has no acceleration the motion model carries.The conformance job re-emits the set and fails when a committed document is not what the service writes, so a sample cannot drift from the code. It normalises one field, the TemporalProperties
timeStamp, which the standard defines as the moment the document is written.Stacked on #56: the TemporalProperty sample carries the type token that PR corrects, so this branch sits on top of it and owes a rebase once it squash-merges. Review #56 first; the second commit here is this PR's own.