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

Swagger schema #10

Merged
merged 11 commits into from
Aug 3, 2018
Merged

Swagger schema #10

merged 11 commits into from
Aug 3, 2018

Conversation

pepegar
Copy link
Member

@pepegar pepegar commented Aug 3, 2018

This PR:

  • implements openapi schema (including the jsonschema subset) from https://swagger.io/specification
  • renames current schemas (avro, protobuf, & frees)
  • creates a droste.contrib file with stuff that potentially can be backported to droste
  • creates JSON encoders for openapi representations

@pepegar pepegar requested a review from a team August 3, 2018 10:19
case AvroSchema.TFixed(_, _, _, _) =>
case AvroF.TEnum(name, _, _, _, symbols) => TSum(name, symbols)
case AvroF.TUnion(options) => TCoproduct(options)
case AvroF.TFixed(_, _, _, _) =>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation on the fixed in the Avro docs is sparse. However, if it is intended to represent byte arrays, then scodec offers support for that. On the other hand, the refined allows restricting the length of a string. However, I would be wary of bringing too many libraries.

In any case, if we do not support them, we should add a more explicit message or exception, saying that skeuomorph library does not have support for Avro fixed types.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My initial idea was to drop Fixed from our ADT, but using refined seems interesting. I kinda discard scodec because one can't use fixed length BitVectors/ByteVectors there, right?

I'll create an issue to remind me to implement fixed usign refined using Array[Byte] Refined MaxSize[N]

Copy link
Member

@juanpedromoreno juanpedromoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff 👌

@pepegar pepegar merged commit 594fa07 into master Aug 3, 2018
@diesalbla diesalbla deleted the swagger-schema branch April 17, 2019 12:15
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.

None yet

3 participants