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

CSharp RestSharp snippets don't generate valid members of RestSharp.Method enum #365

Closed
michaelgwelch opened this issue Sep 15, 2024 · 0 comments · Fixed by #366
Closed

Comments

@michaelgwelch
Copy link
Contributor

michaelgwelch commented Sep 15, 2024

Here's a portion of the code generated from a csharp RestSharp code snippet

var request = new RestRequest(Method.GET);

The issue is that the actual member we need is Method.Get as shown in the source code here:

https://github.com/restsharp/RestSharp/blob/0fba5e727d241b1867bd71efc912594075c2934b/src/RestSharp/Enum.cs#L70

None of the Http Verbs are upper-cased in the enum definition.

Seems like I relatively easy fix. I'll try to write a PR.

michaelgwelch added a commit to michaelgwelch/httpsnippet that referenced this issue Sep 15, 2024
Ensure that code snippets use enum members that are pascal cased and
not upper cased. For example use `Method.Get` instead of `Method.GET` to
ensure the snippets can compile.

fixes Kong#365
michaelgwelch added a commit to michaelgwelch/httpsnippet that referenced this issue Sep 15, 2024
Ensure that code snippets use enum members that are pascal cased and
not upper cased. For example use `Method.Get` instead of `Method.GET` to
ensure the snippets can compile.

fixes Kong#365

use `var` for return "type" of RestSharp request response

The type `IRestResponse` doesn't exist in latest client (version 112)

fixes Kong#367
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 a pull request may close this issue.

1 participant