Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpk: allow names to be URIs in the reference flag when creating a schema. #20757

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

r-vasquez
Copy link
Contributor

jsonschema will introduce URIs as valid reference names.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.1.x
  • v23.3.x
  • v23.2.x

Release Notes

  • none

When creating a schema.

jsonschema will introduce URIs as valid reference
names.
// characters to capture optional ports in the authority and the path.
// 2. Captures any character except ':' (subject).
// 3. Captures any character except ':' (version).
var referenceRegex = regexp.MustCompile(`^([a-zA-Z]+://[^:]+(?::\d+)?(?:/[^:]+)*|[^:]+):([^:]+):([^:]+)$`)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could validate here that the third capturing group is a digit, but the error from L174 (strconv.Atoi) is better for the user to understand where the problem is.

Copy link
Member

@BenPope BenPope left a comment

Choose a reason for hiding this comment

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

LGTM

@Deflaimun
Copy link
Contributor

Should we update docs or is this just an under the hood improvement?

@BenPope
Copy link
Member

BenPope commented Jul 1, 2024

Should we update docs or is this just an under the hood improvement?

The latter

@r-vasquez r-vasquez merged commit 0f2b488 into redpanda-data:dev Jul 2, 2024
23 checks passed
@r-vasquez r-vasquez deleted the uri-in-references branch July 3, 2024 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants