Last active
August 29, 2015 14:17
-
-
Save carlesjove/239163a50f15c6f48def to your computer and use it in GitHub Desktop.
Draft for a CJ Spec definition that includes meta data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Commented lines mean that this would be the assumption unless otherwise is not specified | |
# so: | |
# unless validates_as: is specified, it is validated as a :string | |
# unless required: true is specified, it is required: false | |
module CollectionJson | |
module Spec | |
definition do | |
defines :href, validates_as: :url | |
defines :links do | |
defines :href, required: true, validates_as: :url | |
defines :rel, required: true | |
defines :name # required: false, validates_as: :string | |
defines :prompt | |
defines :render | |
end | |
defines :items do | |
defines :href | |
defines :data | |
defines :name, required: true | |
defines :value | |
defines :prompt | |
end | |
defines :links | |
defines :href, required: true, validates_as: :url | |
defines :rel, required: true | |
defines :name | |
defines :prompt | |
defines :render | |
end | |
end | |
defines :template | |
defines :data | |
defines :name, required: true | |
defines :value | |
defines :prompt | |
end | |
end | |
defines :queries | |
defines :href, required: true, validates_as: :url | |
defines :rel, required: true | |
defines :name | |
defines :prompt | |
defines :data | |
defines :name, required: true | |
defines :value | |
end | |
end | |
defines :error | |
defines :title | |
defines :code | |
defines :message | |
end | |
end | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment