-
Notifications
You must be signed in to change notification settings - Fork 233
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 petstore #191
Fix petstore #191
Conversation
src/Kiota.Builder/KiotaBuilder.cs
Outdated
} else if (schema.IsArray()) | ||
{ | ||
// collection of referenced schema | ||
var type = CreateModelClassAndType(rootNode, currentNode, schema, operation, parentElement, codeNamespace, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have the suffix "Collection" and not be set of CollectionKind Array, or should it by type Pet[] ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should go with an array of pets, I'd like to avoid generating extra classes when it's not needed. We might have to tweak the deserialization process and/or the executor body during testing but this scenario should mostly already be handled. (besides the generation part)
src/Kiota.Builder/KiotaBuilder.cs
Outdated
} else if (schema.IsArray()) | ||
{ | ||
// collection of referenced schema | ||
var type = CreateModelClassAndType(rootNode, currentNode, schema, operation, parentElement, codeNamespace, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should go with an array of pets, I'd like to avoid generating extra classes when it's not needed. We might have to tweak the deserialization process and/or the executor body during testing but this scenario should mostly already be handled. (besides the generation part)
@PureKrome I know our discussions were a bit scattered on the pet store subject, sorry about that, let's regroup here if you don't mind :) |
|
…where logic was duplicated
- maps 2XX to void responses on empty schemas - removes duplicate method call
Kudos, SonarCloud Quality Gate passed! |
@PureKrome: just to recap offline conversations. With this PR you'll be able to generate petstore. However the generated result probably won't build or execute some of the requests properly. That's because we need to relax some type contraint and consolidate the httpcore interface. This additional work is captures in #193 and will be done in another PR. Thanks for all the feedback again! |
Really looking forward to playing around with an generated "Petshop" client! Thanks heaps for putting up with my nagging on this - it's a big stepping stone for me (and IMO, other people exploring this project) |
|
Oh nice! very exciting! I just used VS to generate a client (after pulling down But .. i still need the exciting! |
This is a partial attempt to fix the returning of the pets collection in petstore. It is not a complete solution.