You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
@isekene thanks for the contribution. It seems that the files you added were not uploaded at the right place (under their original directory).
Could you move them to the right directory please?
@darrelmiller while this PR still needs some work (files at not at the right location for instance) before it can be merged, Kiota maps string + duration to TimeSpan in dotnet (and equivalent types in other languages).
I'm happy to PR the registry with with additional type mappings we have in kiota and the ones that @MaggieKimani1 added in #1094
@baywet We need to decide why and when we are going to use these native types. Currently we use them in the default property of OpenApiSchema, but in the future that is going to be out of our hands as it will be implemented by a JsonSchema library. I don't think we should try an convert examples into native types during parsing. Parsing the example into native types requires knowing the complete schema which may be referenced and may live in other files. I think if users want to translate an OpenApiExample into a native object, then we should have separate code to do that. I don't think we need the full set of primitive types.
@darrelmiller the aspect that this PR tries to parse the examples was lost on me because of the formatting/files being at the wrong place.
Outside of examples, just to represent the schema, unless we decide to take a dependency on a JSON schema lib, which is not the case today, I'd argue that having types that represent known type/format combinations is actually a good thing.
People won't have to remember the exact names/combinations, they don't risk making typos, generators would be able to use type inference instead of string comparison, etc...
Thoughts?
@baywet The problem we have is that even today, validation of examples will fail if a schema is a $ref. That's one reason I changed the example validation to be a warning, not an error. Also, we run into issues like this #1106 where we try and represent a JSON number but there is no equivalent type in .NET.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
added timespan type