Skip to content

Conversation

@ppkarwasz
Copy link
Contributor

Currently, the parser specification guarantees that PURL components are output in normalized form (at least for non–type-specific rules). However, the serializer specification assumes that components may originate from external sources and therefore be invalid or unnormalized. This leads to duplication, since both the parser and serializer repeat the same normalization and validation steps.

This draft PR introduces a dedicated section that defines basic normalization and validation routines. These routines can be reused across:

  • PURL parser instructions
  • PURL serializer instructions
  • Implementations that construct PURL objects directly from components

At this stage, the routines are presented in a standalone section. I have not yet integrated them into the parser and serializer instructions, pending feedback on their form (e.g., a simple list of rules vs. named routines similar to WHATWG URL).

Currently, the parser specification guarantees that PURL components are output in normalized form (at least for non–type-specific rules).
However, the serializer specification assumes that components may originate from external sources and therefore be invalid or unnormalized.
This leads to duplication, since both the parser and serializer repeat the same normalization and validation steps.

This draft PR introduces a dedicated section that defines basic normalization and validation routines. These routines can be reused across:

* PURL parser instructions
* PURL serializer instructions
* Implementations that construct PURL objects directly from components

At this stage, the routines are presented in a standalone section. I have not yet integrated them into the parser and serializer instructions, pending feedback on their form (e.g., a simple list of rules vs. named routines similar to [WHATWG URL](https://url.spec.whatwg.org/#idna)).
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.

1 participant