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

Strip anchors from JSON regexes #1027

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

hudson-ai
Copy link
Collaborator

@hudson-ai hudson-ai commented Sep 16, 2024

What it says on the tin. Does regex = regex.lstrip("^").rstrip("$") for any user-passed regex under the json pattern keyword.

This strip is necessary in order to use json generation with the big FHIR schema because of the odd double anchors they use. It "should" be safe to do this, but I'd like some feedback if there is any dissent.

Note that this could potentially be pulled further down into the lexeme code, but I'm not 100% confident that this is "safe" from the perspective of maintaining users' intended semantics.

@hudson-ai
Copy link
Collaborator Author

Ping @mmoskal

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.45%. Comparing base (b424a32) to head (ada4077).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

❗ There is a different number of reports uploaded between BASE (b424a32) and HEAD (ada4077). Click for more details.

HEAD has 32 uploads less than BASE
Flag BASE (b424a32) HEAD (ada4077)
112 80
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1027      +/-   ##
==========================================
- Coverage   70.27%   61.45%   -8.83%     
==========================================
  Files          62       62              
  Lines        4468     4470       +2     
==========================================
- Hits         3140     2747     -393     
- Misses       1328     1723     +395     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@mmoskal mmoskal left a comment

Choose a reason for hiding this comment

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

seems completely safe

@hudson-ai hudson-ai merged commit 78575da into guidance-ai:main Sep 16, 2024
100 checks passed
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.

3 participants