-
Notifications
You must be signed in to change notification settings - Fork 15
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
Adds the parameters to an operation #81
Conversation
Hey! This looks like a needed addition, thanks Fede! I think that, in the case of the parameter ADT, you want the occurrences of Json Schema types to be typed as A, not JsonSchemaF[A]. Sorry, I’m on my phone, but I’ll try to catch-up with this later on |
Modify operation encoder to use Encoder.instance(some recursion problem)
for JsonSchemaF
Reference should be part of JsonSchemaF.
Remove name from object in JsonSchemaF. Extract jsonType method to generate Json.
Review the not required elements in the open api model.
Create a companion object in test to improve readability.
Refactor test helper function.
Fix operation encoder.
Verify codecRoundTrip law for Open Api Codecs. Create an encoder for Fix. Add circe-testing dependency.
Remove unused comments/code.
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.
Outstanding job @BeniVF . The code looks to me 👍
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.
This is awesome @BeniVF, thank you very much for all your work here.
I have asked for some minor changes in the decoder part, in order to not specify the interface for decoders to Fix[JsonSchemaF]
, and allow any Embed[JsonSchemaF, A]
to be used.
Apart of that, it looks very nice!
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
Remove unnecessary use of apply.
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.
Great job mate!
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
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.
Code looks nice, at least for a first iteration.
I have a couple of suggestions, which can be addressed in follow-up PRs:
- In the relevant decoders, or schema definitions, add references (links) to the Open API specification.
- As a way of testing, validate if our schema parser can handle the examples in https://github.com/OAI/OpenAPI-Specification/tree/master/examples.
src/main/scala/higherkindness/skeuomorph/openapi/JsonDecoders.scala
Outdated
Show resolved
Hide resolved
- requestBody in Operation is optional in Open api. - format in string is open for users to define their own types. - object in case you define properties the spec allows to avoid the field type Use explicit method for Decoder[Option[Map[String, A]]] Required is optional for Parameter.
No description provided.