Skip to content

fix: Don't allow resolving a schema that is already known - #444

Merged
martin-g merged 1 commit into
mainfrom
dont-allow-duplicating-names-from-known-schemata
Jan 27, 2026
Merged

martin-g merged 1 commit into
mainfrom
dont-allow-duplicating-names-from-known-schemata

Conversation

@martin-g

Copy link
Copy Markdown
Member

The known_schemata NamesRef is used to resolve schema references, i.e. if a schema ref is not referring to a schema that has been seen/defined earlier in the same schema definition (JSON) then we consult a collection of known (previously parsed) schemas.

If a newly parsed schema is defined earlier then an AmbiguousSchemaDefinition error is returned. The same should be done when a newly parsed schema clashes with a schema with the very same name in known_schemata

@martin-g martin-g added this to the 0.22.0 milestone Jan 27, 2026

@Kriskras99 Kriskras99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we merge #445 first, then I'll rebase this on top of that

The `known_schemata` NamesRef is used to resolve schema references, i.e.
if a schema ref is not referring to a schema that has been seen/defined
earlier in the same schema definition (JSON) then we consult a collection
of known (previously parsed) schemas.

If a newly parsed schema is defined earlier then an AmbiguousSchemaDefinition error is returned.
The same should be done when a newly parsed schema clashes with a schema
with the very same name in `known_schemata`
@Kriskras99
Kriskras99 force-pushed the dont-allow-duplicating-names-from-known-schemata branch from 1abb1bc to 10dd87e Compare January 27, 2026 20:09
@Kriskras99

Copy link
Copy Markdown
Contributor

@martin-g I've rebased this PR on main and modified the logic to save a .clone()

@martin-g
martin-g merged commit f502392 into main Jan 27, 2026
@martin-g
martin-g deleted the dont-allow-duplicating-names-from-known-schemata branch January 27, 2026 20:15
@martin-g

Copy link
Copy Markdown
Member Author

Thank you, @Kriskras99 !

@Kriskras99 Kriskras99 mentioned this pull request Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants