design

package
v0.0.0-...-cad71b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RatingMedia = MediaType("application/cassandra.wannabe.rating+json", func() {
	Description("A movie rating by a user")
	TypeName("rating")
	Reference(RatingPayload)

	Attributes(func() {
		Attribute("movieId")
		Attribute("userId")
		Attribute("rating")
		Required("movieId", "userId", "rating")
	})

	View("default", func() {
		Attribute("movieId")
		Attribute("userId")
		Attribute("rating")
	})
})

RatingMedia is the output type

View Source
var RatingPayload = Type("RatingPayload", func() {
	Attribute("movieId", Integer, func() {
		Minimum(1)
		Example(138493)
	})
	Attribute("userId", Integer, func() {
		Minimum(1)
		Example(56757)
	})
	Attribute("rating", Number, func() {
		Minimum(0.5)
		Maximum(5)
		Example(3.5)
	})
	Required("movieId", "userId", "rating")
})

RatingPayload is the input type

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL