question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for Either

See original GitHub issue

hi.

Would like to be able present a type of Either[Dog,Cat] (or in clojure (either Dog, Cat, Moose) in the Spec. Quite common construct in the FP land. Would be like a enum, but with values of any type.

Currently such a thing could be presented as a complex type with optional fields for all the value => at least the swagger-ui would be able to generate sample models (with all possible alternatives in place) for it. Not perfect, but ~works. Requires also special coercion in the server side to map back into Either.

http://www.scala-lang.org/api/2.11.0/index.html#scala.util.Either

https://github.com/Prismatic/schema/blob/master/test/cljx/schema/core_test.cljx#L194-L203

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:10
  • Comments:50 (24 by maintainers)

github_iconTop GitHub Comments

40reactions
fehguycommented, Aug 11, 2016

allOf, oneOf, not will be supported in 3.0 spec. Approval by @OAI/tdc in comments, implementation details will be in this PR:

https://github.com/OAI/OpenAPI-Specification/pull/741

20reactions
witoldszcommented, Oct 8, 2015

@webron

We thrive to describe deterministic APIs. Sending a single array of both articles and ads makes it that much more difficult to process, especially for strongly-typed languages, so we don’t support it.

This is the most ridiculous explanation I could possibly imagine about not supporting oneOf 😳

Read more comments on GitHub >

github_iconTop Results From Across the Web

support either | English examples in context - Ludwig
High quality example sentences with “support either” in context from reliable sources - Ludwig is the linguistic search engine that helps you to...
Read more >
I'll support you either way definition - Reverso Dictionary
athletic support · n · a more formal term for · → jockstrap.
Read more >
support | LDOCE - Longman Dictionary of Contemporary English
support somebody by (doing) something She supports her family by teaching evening classes.support yourself I have no idea how I am going to...
Read more >
Extracorporeal Life Support for Cardiogenic Shock With Either ...
Extracorporeal Life Support for Cardiogenic Shock With Either a Percutaneous Ventricular Assist Device or an Intra-Aortic Balloon Pump.
Read more >
Support by either parent; hospital, funeral, and legal expenses ...
2013 Maryland Code FAMILY LAW § 5-1033 - Support by either parent; hospital, funeral, and legal expenses. Universal Citation: MD Fam L ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Hashnode Post

No results found