Skip to content

39-Add PUT methods for the JSON-first APIs#63

Merged
csharpfritz merged 3 commits into
csharpfritz:mainfrom
davidbuckleyni:main
May 17, 2022
Merged

39-Add PUT methods for the JSON-first APIs#63
csharpfritz merged 3 commits into
csharpfritz:mainfrom
davidbuckleyni:main

Conversation

@davidbuckleyni
Copy link
Copy Markdown
Contributor

@davidbuckleyni davidbuckleyni commented Mar 25, 2022

Hi @csharpfritz @softchris Let me no if anything else needs done I added a enum value Put=24 We might need to change that number but saw you just doing multiples of 2 for the values.

Fixes #39

@verbedr
Copy link
Copy Markdown
Contributor

verbedr commented Mar 26, 2022

The value of [Flags] enabled enum should be a value of 2 to the power of x where x is a positive natural number. So in this case it should be 32. But then again the value of All should be the sum of all the above.

In general I tend to assign 1 << 0, 1 << 1, 1 << 2 and use int.MaxValue as the value for All. (see for example https://stackoverflow.com/questions/3999922/why-use-the-bitwise-shift-operator-for-values-in-a-c-enum-definition)

Anyway Update and Put are synonyms. Perhaps you should use the Update value of that enum

@davidbuckleyni
Copy link
Copy Markdown
Contributor Author

davidbuckleyni commented Mar 26, 2022

The value of [Flags] enabled enum should be a value of 2 to the power of x where x is a positive natural number. So in this case it should be 32. But then again the value of All should be the sum of all the above.

In general I tend to assign 1 << 0, 1 << 1, 1 << 2 and use int.MaxValue as the value for All. (see for example https://stackoverflow.com/questions/3999922/why-use-the-bitwise-shift-operator-for-values-in-a-c-enum-definition)

Anyway Update and Put are synonyms. Perhaps you should use the Update value of that enum

I was thinking that but what if the program wants to no their is a dif between the update and the put via the enum just thinking out loud here but could catch. The main reason I didn't put it to 32 was because ALL is already at 32. @verbedr

@csharpfritz
Copy link
Copy Markdown
Owner

csharpfritz commented Apr 4, 2022

Agreed with @verbedr - the PUT HTTP verb is the same as update and should reference the Update enum.

Let's consolidate on the ApisToGenerate.Update value and then we can accept this

@davidbuckleyni
Copy link
Copy Markdown
Contributor Author

Agreed with @verbedr - the PUT HTTP verb is the same as update and should reference the Update enum.

Let's consolidate on the ApisToGenerate.Update value and then we can accept this

Ok Wil do that this evening then then put it on thru.

@davidbuckleyni
Copy link
Copy Markdown
Contributor Author

Sorry forgot to tag and say done @csharpfritz

@csharpfritz csharpfritz merged commit 0f22d22 into csharpfritz:main May 17, 2022
@csharpfritz
Copy link
Copy Markdown
Owner

Thank you for that update! This was a good addition

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.

Add PUT methods for the JSON-first APIs

3 participants