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

Should be able to override the generated nicknames #100

Merged
merged 1 commit into from
Jul 17, 2014

Conversation

lhorne
Copy link
Contributor

@lhorne lhorne commented Apr 6, 2014

Currently we have to accept the nickname that is auto generated for each operation. It would be nice to be able to specify a nickname in the endpoint directly.

/Leon

Fixing CHANGELOG.markdown to accout for the 0.7.2 release,
Adding override of auto generated nickname.

@lhorne lhorne changed the title Nickname Should be able to override the generated nicknames Apr 6, 2014
@dblock
Copy link
Member

dblock commented Jul 14, 2014

This seems very custom. Why would you want a nickname for an endpoint?

@lhorne
Copy link
Contributor Author

lhorne commented Jul 14, 2014

The nickname is a required field for swagger. Swagger-codegen is already
populating it with an auto generated string. It is used by downstream code
generators as a default name for each function they generate. We use this
extensively to provide more user friendly function names to our generated
rest client.

I can send you a few examples if that would help.

https://github.com/wordnik/swagger-spec/blob/master/schemas/v1.2/operationObject.json

On Mon, Jul 14, 2014 at 8:10 AM, Daniel Doubrovkine (dB.) @dblockdotorg <
[email protected]> wrote:

This seems very custom. Why would you want a nickname for an endpoint?


Reply to this email directly or view it on GitHub
https://github.com/tim-vandecasteele/grape-swagger/pull/100#issuecomment-48912034
.

@dblock
Copy link
Member

dblock commented Jul 14, 2014

Got it. Can you please rebase this, I'll merge.

@lhorne
Copy link
Contributor Author

lhorne commented Jul 14, 2014

Sure thing, I'll get to this today...

On Mon, Jul 14, 2014 at 9:27 AM, Daniel Doubrovkine (dB.) @dblockdotorg <
[email protected]> wrote:

Got it. Can you please rebase this, I'll merge.


Reply to this email directly or view it on GitHub
https://github.com/tim-vandecasteele/grape-swagger/pull/100#issuecomment-48922368
.

@lhorne
Copy link
Contributor Author

lhorne commented Jul 14, 2014

Ok, this should be done. I'm fairly new to github, let me know if you have
any problems.

On Mon, Jul 14, 2014 at 10:03 AM, Leon Horne [email protected] wrote:

Sure thing, I'll get to this today...

On Mon, Jul 14, 2014 at 9:27 AM, Daniel Doubrovkine (dB.) @dblockdotorg <
[email protected]> wrote:

Got it. Can you please rebase this, I'll merge.


Reply to this email directly or view it on GitHub
https://github.com/tim-vandecasteele/grape-swagger/pull/100#issuecomment-48922368
.

@@ -1,5 +1,6 @@
### Next Release

* [#100] Adding ability to specify a nickname for an endpoint - [@lhorne](https://github.com/lhorne).
Copy link
Member

Choose a reason for hiding this comment

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

Please make this identical to the lines below. This is missing a link after the [#100](.. here ...).

@dblock
Copy link
Member

dblock commented Jul 14, 2014

Sorry, I forgot to ask (too many PRs) - this needs a test, too.

 Swagger has a nickname filed specified in the 1.2 standard. It is used
to generate an alternate name for code generators to use for that api.
This patch provides a way to override the generated nickname with one
specified in the grape documentation.

    Example:
          desc(
            'Get all the cloud profiles in the system',
            :nickname => 'getAllCloudProfiles',
          )
@lhorne
Copy link
Contributor Author

lhorne commented Jul 17, 2014

I've added the test you requested, let me know if you need anything else done.
/Leon

@dblock
Copy link
Member

dblock commented Jul 17, 2014

Merging, thanks.

dblock added a commit that referenced this pull request Jul 17, 2014
Should be able to override the generated nicknames
@dblock dblock merged commit 28f1bc0 into ruby-grape:master Jul 17, 2014
@lhorne lhorne deleted the FW-Port branch February 26, 2017 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants