Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add mojito configuration schemas #1054

Closed
wants to merge 2 commits into from

4 participants

@Yujun-Qian
Owner

This pull request adds mojito configuration schemas. These schemas are in compliance with IETF json schema draft, and are defined according to http://developer.yahoo.com/cocktails/mojito/docs/intro/mojito_configuring.html. The related code change has been sent to mojito-cli repository.

@caridy
Owner

I will argue that the schemas should not be part of mojito source, but part of mojito-cli-validate or something similar but not core. We can also explore a similar approach to the one we have lineup for the initial archetypes that can bring some default npm devDependencies that can be used by cli to resolve few other things.

@Yujun-Qian
Owner

The configuration of mojito keeps evolving, accordingly these schemas will change with each version of mojito. I think it makes sense for the shemas to be part of mojito, and the validate command to be part of mojito-cli, so that the user can use a single "mojito validate" command to validate all his mojito applications.

@isao

We asked @Yujun-Qian to have the schemas included with core mojito source, which makes the most sense at this point-- especially if we think it will be changed.

I also think we must validate our test apps against the mojito schemas in CI. +1

@Yujun-Qian Yujun-Qian referenced this pull request in yahoo/mojito-cli
Closed

add "validate" subcommand #9

@imalberto imalberto closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 2, 2013
  1. add mojito configuration schemas

    Yujun Qian authored
Commits on Apr 12, 2013
  1. @Yujun-Qian

    Merge pull request #1 from yahoo/develop

    Yujun-Qian authored
    Develop
This page is out of date. Refresh to see the latest.
View
256 schemas/application.schema
@@ -0,0 +1,256 @@
+{
+ "type": "array",
+ "id": "application configuration",
+ "items": {
+ "type": "object",
+ "id": "application",
+ "additionalProperties": true,
+ "properties": {
+ "settings": {
+ "type": "array",
+ "id": "context",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ "selector": {
+ "type": "string"
+ },
+ "appPort": {
+ "type": "number",
+ "minimum": 0,
+ "maximum": 65535
+ },
+ "actionTimeout": {
+ "type": "number",
+ "minimum": 0
+ },
+ "middleware": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "mojitDirs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "mojitsDirs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "routesFiles": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tunnelPrefix": {
+ "type": "string"
+ },
+ "tunnelTimeout": {
+ "type": "number",
+ "minimum": 0
+ },
+ "builds": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "html5app": {
+ "type": "object",
+ "properties": {
+ "attachManifest": {
+ "type": "boolean"
+ },
+ "buildDir": {
+ "type": "string"
+ },
+ "forceRelativePaths": {
+ "type": "boolean"
+ },
+ "urls": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "hybridapp": {
+ "type": "object",
+ "properties": {
+ "buildDir": {
+ "type": "string"
+ },
+ "forceRelativePaths": {
+ "type": "boolean"
+ },
+ "packages": {
+ "type": "object"
+ },
+ "urls": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "viewEngine": {
+ "type": "object",
+ "properties": {
+ "cacheTemplates" : {
+ "type": "boolean"
+ },
+ "preloadTemplates": {
+ "type": "boolean"
+ }
+ }
+ },
+ "staticHandling": {
+ "type": "object",
+ "properties": {
+ "appName": {
+ "type": "string"
+ },
+ "cache": {
+ "type": "boolean"
+ },
+ "forceUpdate": {
+ "type": "boolean"
+ },
+ "frameworkName": {
+ "type": "string"
+ },
+ "maxAge": {
+ "type": "number"
+ },
+ "prefix": {
+ "type": "string"
+ }
+ }
+ },
+ "yui": {
+ "type": "object",
+ "properties": {
+ "showConsoleInClient": {
+ "type": "boolean"
+ },
+ "config": {
+ "type": "object",
+ "properties": {
+ "base": {
+ "type": "string"
+ },
+ "seed": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "combine": {
+ "type": "boolean"
+ },
+ "comboBase": {
+ "type": "string"
+ },
+ "comboSep": {
+ "type": "string"
+ },
+ "root": {
+ "type": "string"
+ },
+ "debug": {
+ "type": "boolean"
+ },
+ "logExclude": {
+ "type": "object",
+ "patternProperties": {
+ "^.*$": {
+ "type": "boolean"
+ }
+ }
+ },
+ "logInclude": {
+ "type": "object",
+ "patternProperties": {
+ "^.*$": {
+ "type": "boolean"
+ }
+ }
+ },
+ "logLevel": {
+ "type": "string",
+ "enum": ["debug", "mojito", "info", "warn", "error", "none"]
+ },
+ "logLevelOrder": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": ["debug", "mojito", "info", "warn", "error", "none"]
+ }
+ }
+ }
+ }
+ }
+ },
+ "specs": {
+ "type": "object",
+ "id": "specs",
+ "patternProperties": {
+ "^.*$": {
+ "type": "object",
+ "id": "spec",
+ "additonalProperties": false,
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "base": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "defer": {
+ "type": "boolean"
+ },
+ "propagateFailure": {
+ "type": "boolean"
+ },
+ "proxy": {
+ "$ref": "spec"
+ },
+ "config": {
+ "type": "object",
+ "properties": {
+ "child": {
+ "$ref": "spec"
+ },
+ "children": {
+ "$ref": "specs"
+ },
+ "deploy": {
+ "type": "boolean"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
View
84 schemas/default.schema
@@ -0,0 +1,84 @@
+{
+ "type": "array",
+ "id": "mojit default spec",
+ "items": {
+ "type": "object",
+ "additionalProperties": true,
+ "properties": {
+ "settings": {
+ "type": "array",
+ "id": "context",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ "type": {
+ "type": "string"
+ },
+ "base": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "defer": {
+ "type": "boolean"
+ },
+ "propagateFailure": {
+ "type": "boolean"
+ },
+ "proxy": {
+ "type": "object",
+ "id": "spec",
+ "additionalProperties": false,
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "base": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "defer": {
+ "type": "boolean"
+ },
+ "propagateFailure": {
+ "type": "boolean"
+ },
+ "proxy": {
+ "$ref": "spec"
+ },
+ "config": {
+ "type": "object",
+ "id": "config",
+ "properties": {
+ "child": {
+ "$ref": "spec"
+ },
+ "children": {
+ "type": "object",
+ "patternProperties": {
+ "^.*$": {
+ "$ref": "spec"
+ }
+ }
+ },
+ "deploy": {
+ "type": "boolean"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "config": {
+ "$ref": "config"
+ }
+ }
+ }
+}
View
66 schemas/defaults.schema
@@ -0,0 +1,66 @@
+{
+ "type": "array",
+ "id": "mojit default configuration",
+ "items": {
+ "type": "object",
+ "additionalProperties": false,
+ "properties": {
+ "settings": {
+ "type": "array",
+ "id": "context",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ },
+ "config": {
+ "type": "object",
+ "id": "config",
+ "properties": {
+ "child": {
+ "type": "object",
+ "id": "spec",
+ "additionalProperties": false,
+ "properties": {
+ "type": {
+ "type": "string"
+ },
+ "base": {
+ "type": "string"
+ },
+ "action": {
+ "type": "string"
+ },
+ "defer": {
+ "type": "boolean"
+ },
+ "propagateFailure": {
+ "type": "boolean"
+ },
+ "proxy": {
+ "$ref": "spec"
+ },
+ "config": {
+ "$ref": "config"
+ }
+ }
+ },
+ "children": {
+ "type": "object",
+ "patternProperties": {
+ "^.*$": {
+ "$ref": "spec"
+ }
+ }
+ },
+ "deploy": {
+ "type": "boolean"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+}
View
21 schemas/definition.schema
@@ -0,0 +1,21 @@
+{
+ "type": "array",
+ "id": "definition configuration",
+ "items": {
+ "type": "object",
+ "id": "definition",
+ "additionalProperties": true,
+ "properties": {
+ "settings": {
+ "type": "array",
+ "id": "context",
+ "items": {
+ "type": "string"
+ }
+ },
+ "appLevel": {
+ "type": "boolean"
+ }
+ }
+ }
+}
View
52 schemas/routes.schema
@@ -0,0 +1,52 @@
+{
+ "type": "array",
+ "id": "routes configuration",
+ "items": {
+ "type": "object",
+ "id": "route",
+ "additionalProperties": false,
+ "properties": {
+ "settings": {
+ "type": "array",
+ "id": "context",
+ "required": true,
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "patternProperties": {
+ "^((?!^settings$).)*$": {
+ "type": "object",
+ "id": "routing",
+ "additionalProperties": false,
+ "properties": {
+ "call": {
+ "type": "string",
+ "required": true
+ },
+ "params": {
+ "type": ["object", "string"]
+ },
+ "path": {
+ "type": "string",
+ "required": true
+ },
+ "regex": {
+ "type": "object"
+ },
+ "verbs": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "get", "post", "put", "delete",
+ "GET", "POST", "PUT", "DELETE"
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+}
Something went wrong with that request. Please try again.