Repository navigation
Conversation
… export The cardinality of a specification is set by minOccurs and maxOccurs on its applicability: required is 1 and unbounded, optional is 0 and unbounded, prohibited is 0 and 0. They were ignored on load and always written as 1 and unbounded on export, so an optional or prohibited specification came back required. Read both on load into IDSSpecification.minOccurs and maxOccurs (default 1 and unbounded) and write them back on export.
5 of 8 tasks
This branch has not been deployed
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.
Description
Part of #831 (the "Specification cardinality" row).
The cardinality of a specification is set by
minOccursandmaxOccurson its<applicability>: required is1/unbounded, optional is0/unbounded, prohibited is0/0(IDS developer guide, Optionality).load()ignored both, andIDSSpecification.serialize()always wroteminOccurs="1" maxOccurs="unbounded". So an optional or prohibited specification came back from an export as a required one.IDSSpecificationnow hasminOccurs(default1) andmaxOccurs(default"unbounded").load()reads them from the applicability andserialize()writes them back. No result changes:test()is untouched, evaluating the cardinality is a separate change.Additional context
specification-occurs.test.ts: the defaults, and optional and prohibited surviving a load and an export. All three tests fail onmain(minOccursisundefined) and pass with the change.vitest --runon the IDS folder: all pass.tsc -p tsconfig-build.json --noEmitis clean.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following:
feat(examples): add hello-world example).fixes #123).