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

feat(gen): add OperationName type (an alias for string type) #1337

Merged
merged 2 commits into from
Nov 1, 2024

Conversation

saccho
Copy link
Contributor

@saccho saccho commented Oct 31, 2024

Overview

Introducing the OperationName type (a string type alias for backward compatibility) and automatically generating all OperationName constants enhances the usability and safety for users using security features.

Users typically do not need to be aware of Ogen's OperationName. By changing the type from string to OperationName and allowing users to utilize the auto-generated OperationName, applications can be built more easily and safely.

Why?

When using SecurityHandler, the strings assigned to operationName were unclear. I believed that having auto-generated OperationName constants would improve clarity and allow compiler checks for enhanced safety, so I added them.

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.44%. Comparing base (dbd90b0) to head (20a20b7).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1337   +/-   ##
=======================================
  Coverage   71.44%   71.44%           
=======================================
  Files         190      190           
  Lines       15587    15588    +1     
=======================================
+ Hits        11136    11137    +1     
  Misses       3898     3898           
  Partials      553      553           

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

Copy link
Member

@tdakkota tdakkota left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@tdakkota tdakkota merged commit ccbcb6f into ogen-go:main Nov 1, 2024
14 checks passed
@saccho saccho deleted the feat/operation-name-alias branch November 1, 2024 02:13
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