Repository navigation
Misc fixes - #288
Merged
plokhotnyuk merged 3 commits intoOct 16, 2026
Merged
Misc fixes#288
Conversation
plokhotnyuk
force-pushed
the
fix-validation-bugs
branch
3 times, most recently
from
October 14, 2026 14:27
a1d03a0 to
1123f0a
Compare
niegrzybkowski
requested changes
Oct 14, 2026
niegrzybkowski
left a comment
Contributor
There was a problem hiding this comment.
Remove the CURIE/prefixology things. They will not happen anymore after we fix curies properly.
plokhotnyuk
force-pushed
the
fix-validation-bugs
branch
2 times, most recently
from
October 16, 2026 09:30
e891a5a to
342fa08
Compare
Why:
`Case.isAllowedAscii` checked `c >= ' ' || c <= '~'`, which is true for every
character. So the `NonAsciiName` error was never reported. A name like `wąż🐍`
got only a `NonStandardSeparator` warning, while the issue type and the
comment in `checkNaming` say a non-ASCII name is an error.
What changed:
- `Case.isAllowedAscii` uses `&&`, so it accepts only printable ASCII
(' ' to '~').
- `checkNaming` no longer skips surrogates when listing non-standard
separators. Names that reach that check are all ASCII now, so there are no
surrogates to skip.
- The `wąż🐍` test in `SchemaViewSpec` now expects `NonAsciiName` and no
`NonStandardSeparator`. New `CaseSpec` test for `isAllowedAscii`.
Why:
Slot derivation applies the class `slot_usage` first and then the slot
definition. `combineWith` keeps the first value for scalar metaslots
(`combineFallback`), so `slot_usage` has precedence over the slot. But
`combineMap` used `v1.concat(v2)`, so for a key in both maps the value from
the slot definition had precedence. For example, a slot with
`annotations: {a: 1}` and a class with `slot_usage: {s: {annotations: {a: 2}}}`
derived `a: 1`, while `description` from the same `slot_usage` was kept. This
affected `annotations`, `extensions`, `alt_descriptions`, `local_names` and
`type_mappings`.
What changed:
- `combineMap` keeps the value from the first map for a key in both maps,
and adds only the keys missing from it, as the Scaladoc now says.
- New `CombiningSpec` for `combineMap`, and a `SlotDerivationSpec` test for an
annotation set in both the slot and `slot_usage`.
Why: The FastUtils Scaladoc says the *Fast methods work exactly like the standard Option methods. But orElseFast was `if (opt eq None) fallback else opt`, and opt is an inline parameter, so the expression it stands for ran twice when it had a value. For example, `sv.resolve(...).orElseFast(...)` in SchemaValidator resolved the same reference twice. What changed: - orElseFast stores the option in a local val before the `eq None` check. - New FastUtilsSpec that checks every *Fast method against the Option method it replaces, for both Some and None. It also counts how many times the receiver and the argument are evaluated: the receiver once, the argument only when the standard method would use it.
plokhotnyuk
force-pushed
the
fix-validation-bugs
branch
from
October 16, 2026 10:28
342fa08 to
26f5c09
Compare
niegrzybkowski
approved these changes
Oct 16, 2026
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.
Report non-ASCII element names as
NonAsciiNameWhy:
Case.isAllowedAsciicheckedc >= ' ' || c <= '~', which is true for every character.So
NonAsciiNamewas never reported. A name likewąż🐍got only aNonStandardSeparatorwarning, while the issue type and the comment in
checkNamingsay a non-ASCII name is an error.What changed:
isAllowedAsciiuses&&, so it accepts only printable ASCII (' 'to'~').checkNamingno longer skips surrogates when listing non-standard separators. Names that reachthat check are all ASCII now.
wąż🐍test inSchemaViewSpecnow expectsNonAsciiName. NewCaseSpectest forisAllowedAscii.User-visible change: a schema with a non-ASCII element name now fails
validate(exit code 1).NonAsciiNameis an error, not a fatal issue, so generators still run.Give
slot_usageprecedence when merging map metaslotsWhy: slot derivation applies the class
slot_usagefirst and then the slot definition.combineWithkeeps the first value for single-value metaslots, soslot_usagehas precedencethere. But
combineMapusedv1.concat(v2), so for a key in both maps the slot definition hadprecedence. For example:
The derived slot
C.shada: 1, while adescriptionfrom the sameslot_usagewas kept. Thisaffected
annotations,extensions,alt_descriptions,local_namesandtype_mappings.What changed:
combineMapis nowv2.concat(v1), so for a key in both maps the value from the first map(the more specific one) is kept. For small maps, which keep insertion order, the keys of the
second map now come first, so
generate linkmlmay list such map entries in a different order.CombiningSpec, and aSlotDerivationSpectest for an annotation set in both places.Evaluate the receiver of
orElseFastonceWhy: the
FastUtilsScaladoc says the*Fastmethods work exactly like the standardOptionmethods. ButorElseFastwasif (opt eq None) fallback else opt, andoptis aninline parameter, so the expression it stands for ran twice when it had a value. For example,
sv.resolve(...).orElseFast(...)inSchemaValidatorresolved the same reference twice. That iswasted work, and it gives wrong results if the expression has side effects.
What changed:
orElseFaststores the option in a localvalbefore theeq Nonecheck.FastUtilsSpecthat checks every*Fastmethod against theOptionmethod it replaces,for both
SomeandNone. It also counts how many times the receiver and the argument areevaluated: the receiver once, the argument only when the standard method would use it.