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

README - fix syntax highlighting to work on GitHub #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Installation

Add the following to your `build.sbt`

``` {.scala}
```scala
libraryDependencies += "com.timeout" %% "docless" % doclessVersion
```

Expand All @@ -46,7 +46,7 @@ case classes and ADTs at compile time. By scraping unnecessary
boilerplate code, this approach helps keeping documentation in sync with
the relevant business entities.

``` {.scala}
```scala
import com.timeout.docless.schema._

case class Pet(id: Int, name: String, tag: Option[String])
Expand All @@ -59,7 +59,7 @@ val petSchema = JsonSchema.deriveFor[Pet]
Given a case class, generating a JSON schema is as easy as calling the
`deriveFor` method and supplying the class as type parameter.

``` {.scala}
```scala
scala> petSchema.asJson
res2: io.circe.Json =
{
Expand Down Expand Up @@ -95,7 +95,7 @@ Arguably, the idea of ADT or sum type is best expressed using JsonSchema
this library uses the latter as default. This can be easily overriden by
defining an implicit instance of `derive.Config` in the local scope:

``` {.scala}
```scala
import com.timeout.docless.schema.derive.{Config, Combinator}

sealed trait Contact
Expand All @@ -109,7 +109,7 @@ object Contact {
}
```

``` {.scala}
```scala
scala> Contact.schema.asJson
res5: io.circe.Json =
{
Expand All @@ -133,7 +133,7 @@ For ADTs, as well as for case classes, the
method can be used to access the child definitions referenced in a
schema:

``` {.scala}
```scala
scala> Contact.schema.relatedDefinitions.map(_.id)
res6: scala.collection.immutable.Set[String] = Set(PhoneOnly, EmailOnly, EmailAndPhoneNum)
```
Expand All @@ -143,7 +143,7 @@ res6: scala.collection.immutable.Set[String] = Set(PhoneOnly, EmailOnly, EmailAn
Docless can automatically derive a Json schema enum for sum types
consisting of case objects only:

``` {.scala}
```scala

sealed trait Diet

Expand All @@ -156,14 +156,14 @@ Enumeration values can be automatically converted into a string
identifier\
using one of the pre-defined formats.

``` {.scala}
```scala
import com.timeout.docless.schema.PlainEnum.IdFormat

implicit val format: IdFormat = IdFormat.SnakeCase
val schema = JsonSchema.deriveEnum[Diet]
```

``` {.scala}
```scala
scala> schema.asJson
res10: io.circe.Json =
{
Expand All @@ -179,7 +179,7 @@ Finally, types that extend
[enumeratum](https://github.com/lloydmeta/enumeratum) `EnumEntry` are
also supported through the `EnumSchema` trait:

``` {.scala}
```scala
import enumeratum._
import com.timeout.docless.schema.EnumSchema

Expand All @@ -202,7 +202,7 @@ This trait will define on the companion object an implicit instance of\
Docless provides a native scala implementation of the Swagger 2.0 model
together with a DSL to easily manipulate and transform it.

``` {.scala}
```scala

import com.timeout.docless.swagger._
import com.timeout.docless.schema._
Expand Down Expand Up @@ -248,7 +248,7 @@ generic facility to enrich separate code modules with Swagger metadata,
being these routes, controllers, or whatever else your framework calls
them.

``` {.scala}
```scala
import com.timeout.docless.swagger._

case class Dino(name: String, extinctedSinceYears: Long, diet: Diet)
Expand Down Expand Up @@ -278,7 +278,7 @@ of endpoint paths and schema definitions. The `aggregate` method in the
`PathGroup` companion object can then be used to merge the supplied
groups into a single Swagger API description.

``` {.scala}
```scala
scala> val apiInfo = Info("Example API")
apiInfo: com.timeout.docless.swagger.Info = Info(Example API,1.0,None,None,None,None)

Expand Down