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

fix(#20): Add params option to the mustermann grape pattern for taking into account the parameter type #21

Merged
merged 3 commits into from
Nov 24, 2023

Conversation

jcagarcia
Copy link
Collaborator

@jcagarcia jcagarcia commented Nov 13, 2023

Hey 👋

I've decided to create this PR for including the params options to the mustermann grape pattern. Fixing #20.

I've added several tests and seems that if we provide the proper params information, we are able to generate more precise regular expressions.

Mustermann.new('/:id', type: :grape, params: {"id"=>{:type=>"Integer"}}).params('/1') # => { id: '1'}
Mustermann.new('/:id', type: :grape, params: {"id"=>{:type=>"Integer"}}).params('/foo') # => nil
Mustermann.new('/:id', type: :grape, params: {"id"=>{:type=>"String"}}).params('/foo') # => { id: 'foo'}

What do you think?

…rn for taking into account the parameter type
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

I like it! Thanks @jcagarcia.

Let's increment the version to 1.1.0 here since this is a new feature.

@namusyaka, you around?

CHANGELOG.md Outdated Show resolved Hide resolved
@dblock
Copy link
Member

dblock commented Nov 15, 2023

As you fix CI, see if it's easy to add a Ruby 3.x, feel free to make separate PRs.

@jcagarcia
Copy link
Collaborator Author

Hi @dblock ,

Thanks a lot for the review. I've updated the version to 1.1.0. Also, I've added Ruby 3.x to the gitHub action that runs the tests.

Let me know if something else is needed! :)

@dblock
Copy link
Member

dblock commented Nov 15, 2023

Will let this marinate a little and see if we hear from @namusyaka, otherwise I'll merge soon.

@jcagarcia
Copy link
Collaborator Author

Hi again @dblock 👋

Do you think we can merge this change and release 1.1.0 version of mustermann-grape?

@dblock dblock merged commit b656da3 into ruby-grape:master Nov 24, 2023
3 checks passed
@dblock
Copy link
Member

dblock commented Nov 24, 2023

I released 1.1.0.

@dblock
Copy link
Member

dblock commented Nov 26, 2023

@jcagarcia Want to help us with maintaining mustermann-grape? LMK your rubygems username if you're down.

@jcagarcia
Copy link
Collaborator Author

@jcagarcia Want to help us with maintaining mustermann-grape? LMK your rubygems username if you're down.

Sure @dblock ! Really happy to help :) This is my rubygems profile https://rubygems.org/profiles/jcagarcia

@dblock
Copy link
Member

dblock commented Nov 26, 2023

Accept the maintainer invite here: https://github.com/ruby-grape/mustermann-grape/invitations. Added you to Rubygems! Thanks.

@jcagarcia jcagarcia deleted the issue-20 branch November 26, 2023 21:12
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