From 944f1cf485c71a61e2098e77dbd8d83a611bd613 Mon Sep 17 00:00:00 2001 From: Serano Colameo Date: Fri, 12 Mar 2021 09:35:27 +0100 Subject: [PATCH] Feature/fixes2 (#26) * fixed issues * merged * sync --- JDLApplicationOptions.md | 72 +++++----- scripts/build.sh | 2 + src/JDLApplicationOptions.schema.json | 2 - src/JDLDeploymentOptions.schema.json | 2 - src/JDLFields.schema.json | 1 - src/JDLLanguages.schema.json | 1 - src/JDLOptions.schema.json | 2 - src/JDLValidations.schema.json | 182 +++++++++++++------------- 8 files changed, 129 insertions(+), 135 deletions(-) diff --git a/JDLApplicationOptions.md b/JDLApplicationOptions.md index 938a0cb..7eb1885 100644 --- a/JDLApplicationOptions.md +++ b/JDLApplicationOptions.md @@ -1,37 +1,37 @@ ## Application Options -| Option | BaseType | ParseType | Values | Description | -| -------------------- | -------- | --------------------- | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| applicationType | STRING | EnumLiteral | monolith, microservice, gateway | One of the listed values | -| blueprints | STRING | ListOfAnyLiterals | generator-jhipster-dotnetcore, any-blueprint-from-marketplace | Any blueprint identifier e.g. [generator-jhipster-dotnetcore]. Please note that the prefix 'generator-jhipster-' is optional. | -| entitySuffix | STRING | JavaIdentifierLiteral | Entity | Suffix for entities. false for empty string | -| serviceDiscoveryType | STRING | EnumLiteral | eureka, consul, no, false | One of the listed values | -| devDatabaseType | STRING | EnumLiteral | h2Disk, h2Memory, mysql, mariadb, mssql, postgresql, oracle, no, mongodb, cassandra, couchbase | One of the listed values or one of the prod database type | -| testFrameworks | LIST | ListOfLiterals | protractor, cucumber, gatling | Braces mandatory | -| clientThemeVariant | STRING | AnyLiteral | primary | You can put whatever value you want, provided you know it will work (like dark, or light) | -| dtoSuffix | STRING | JavaIdentifierLiteral | DTO | Suffix for DTOs. false for empty string | -| nativeLanguage | STRING | LangIsoCode | en | One of the languages as ISO code supported by JHipster | -| jwtSecretKey | STRING | Namespace | | | -| serverPort | INTEGER | Number | 8080, 8081, 9999 | Depends on the app type | -| skipClient | BOOLEAN | Boolean | false | true or false | -| messageBroker | STRING | EnumLiteral | kafka, false | One of the listed values | -| cacheProvider | STRING | EnumLiteral | ehcache, hazelcast, caffeine, infinispan, memcached, redis, no | One of the listed values, ehcache for monoliths and gateways, hazelcast otherwise | -| websocket | STRING | EnumLiteral | spring-websocket, false | | -| buildTool | STRING | EnumLiteral | maven, gradle | One of the listed values | -| packageName | STRING | Namespace | | Sets the packageFolder option | -| prodDatabaseType | STRING | EnumLiteral | mysql, mariadb, mssql, postgresql, oracle, no, mongodb, cassandra, couchbase | One of the listed values | -| baseName | STRING | AnyLiteral | jhipster | | -| skipUserManagement | BOOLEAN | Boolean | true | | -| enableTranslation | BOOLEAN | Boolean | true | | -| languages | LIST | ListOfLangIsoCodes | en, fr | Braces are mandatory | -| searchEngine | STRING | EnumLiteral | elasticsearch, couchbase, false | One of the listed values | -| jhiPrefix | STRING | JavaIdentifierLiteral | jhi | | -| clientPackageManager | STRING | EnumLiteral | npm | One of the listed values | -| databaseType | STRING | EnumLiteral | sql, mongodb, cassandra, couchbase, neo4j, no | One of the listed values or one of the prod database type | -| reactive | BOOLEAN | Boolean | false | true or false | -| enableSwaggerCodegen | BOOLEAN | Boolean | false | true or false | -| skipServer | BOOLEAN | Boolean | false | true or false | -| clientFramework | STRING | EnumLiteral | angularX, react, vue | One of the listed values | -| enableHibernateCache | BOOLEAN | Boolean | true | true or false | -| useSass | BOOLEAN | Boolean | | true or false | -| authenticationType | STRING | EnumLiteral | jwt, session, oauth2 | Authentication Type | -| clientTheme | STRING | AnyLiteral | none | You can put whatever value you want, provided you know it will work (like yeti) | +| Option | BaseType | ParseType | Values | Description | +| -------------------- | -------- | --------------------- | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- | +| applicationType | STRING | EnumLiteral | monolith, microservice, gateway | One of the listed values | +| blueprints | STRING | ListOfAnyLiterals | generator-jhipster-dotnetcore, any-blueprint-from-marketplace | Any blueprint identifier e.g. [generator-jhipster-dotnetcore]. Please note that the prefix 'generator-jhipster-' is optional. | +| entitySuffix | STRING | JavaIdentifierLiteral | Entity | Suffix for entities. false for empty string | +| serviceDiscoveryType | STRING | EnumLiteral | eureka, consul, no, false | One of the listed values | +| devDatabaseType | STRING | EnumLiteral | h2Disk, h2Memory, mysql, mariadb, mssql, postgresql, oracle, no, mongodb, cassandra, couchbase | One of the listed values or one of the prod database type | +| testFrameworks | LIST | ListOfLiterals | protractor, cucumber, gatling | Braces mandatory | +| clientThemeVariant | STRING | AnyLiteral | primary | You can put whatever value you want, provided you know it will work (like dark, or light) | +| dtoSuffix | STRING | JavaIdentifierLiteral | DTO | Suffix for DTOs. false for empty string | +| nativeLanguage | STRING | LangIsoCode | en | One of the languages as ISO code supported by JHipster | +| jwtSecretKey | STRING | Namespace | | | +| serverPort | INTEGER | Number | 8080, 8081, 9999 | Depends on the app type | +| skipClient | BOOLEAN | Boolean | false | true or false | +| messageBroker | STRING | EnumLiteral | kafka, false | One of the listed values | +| cacheProvider | STRING | EnumLiteral | ehcache, hazelcast, caffeine, infinispan, memcached, redis, no | One of the listed values, ehcache for monoliths and gateways, hazelcast otherwise | +| websocket | STRING | EnumLiteral | spring-websocket, false | | +| buildTool | STRING | EnumLiteral | maven, gradle | One of the listed values | +| packageName | STRING | Namespace | | Sets the packageFolder option | +| prodDatabaseType | STRING | EnumLiteral | mysql, mariadb, mssql, postgresql, oracle, no, mongodb, cassandra, couchbase | One of the listed values | +| baseName | STRING | AnyLiteral | jhipster | | +| skipUserManagement | BOOLEAN | Boolean | true | | +| enableTranslation | BOOLEAN | Boolean | true | | +| languages | LIST | ListOfLangIsoCodes | en, fr | Braces are mandatory | +| searchEngine | STRING | EnumLiteral | elasticsearch, couchbase, false | One of the listed values | +| jhiPrefix | STRING | JavaIdentifierLiteral | jhi | | +| clientPackageManager | STRING | EnumLiteral | npm | One of the listed values | +| databaseType | STRING | EnumLiteral | sql, mongodb, cassandra, couchbase, neo4j, no | One of the listed values or one of the prod database type | +| reactive | BOOLEAN | Boolean | false | true or false | +| enableSwaggerCodegen | BOOLEAN | Boolean | false | true or false | +| skipServer | BOOLEAN | Boolean | false | true or false | +| clientFramework | STRING | EnumLiteral | angularX, react, vue | One of the listed values | +| enableHibernateCache | BOOLEAN | Boolean | true | true or false | +| useSass | BOOLEAN | Boolean | | true or false | +| authenticationType | STRING | EnumLiteral | jwt, session, oauth2 | One of the listed values | +| clientTheme | STRING | AnyLiteral | none | You can put whatever value you want, provided you know it will work (like yeti) | diff --git a/scripts/build.sh b/scripts/build.sh index a966036..ee0b2ee 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + files=$(find src -name *.json ! -path "*.schema.*" | awk -F/ '{ print $NF }' | cut -d '.' -f 1) for f in $files diff --git a/src/JDLApplicationOptions.schema.json b/src/JDLApplicationOptions.schema.json index 14423e9..3b1a8e6 100644 --- a/src/JDLApplicationOptions.schema.json +++ b/src/JDLApplicationOptions.schema.json @@ -29,7 +29,6 @@ } ] ], - "additionalItems": true, "items": { "anyOf": [ { @@ -102,7 +101,6 @@ "microservice" ] ], - "additionalItems": true, "items": { "anyOf": [ { diff --git a/src/JDLDeploymentOptions.schema.json b/src/JDLDeploymentOptions.schema.json index 83cef5e..da176aa 100644 --- a/src/JDLDeploymentOptions.schema.json +++ b/src/JDLDeploymentOptions.schema.json @@ -5,7 +5,6 @@ "title": "The root schema", "description": "The root schema comprises the entire JSON document.", "default": [], - "additionalItems": true, "items": { "$id": "#/items", "anyOf": [ @@ -76,7 +75,6 @@ "\"docker push\"" ] ], - "additionalItems": true, "items": { "$id": "#/items/anyOf/0/properties/values/items", "anyOf": [ diff --git a/src/JDLFields.schema.json b/src/JDLFields.schema.json index b49a417..cd86cec 100644 --- a/src/JDLFields.schema.json +++ b/src/JDLFields.schema.json @@ -5,7 +5,6 @@ "title": "The Root Schema", "description": "The root schema comprises the entire JSON document.", "default": [], - "additionalItems": true, "items": { "$id": "#/items", "type": "object", diff --git a/src/JDLLanguages.schema.json b/src/JDLLanguages.schema.json index ac0d83b..7754b5a 100644 --- a/src/JDLLanguages.schema.json +++ b/src/JDLLanguages.schema.json @@ -5,7 +5,6 @@ "title": "The Root Schema", "description": "The root schema comprises the entire JSON document.", "default": [], - "additionalItems": true, "items": { "$id": "#/items", "type": "object", diff --git a/src/JDLOptions.schema.json b/src/JDLOptions.schema.json index d5c0db6..6f1e6ca 100644 --- a/src/JDLOptions.schema.json +++ b/src/JDLOptions.schema.json @@ -5,7 +5,6 @@ "title": "The Root Schema", "description": "The root schema comprises the entire JSON document.", "default": [], - "additionalItems": true, "items": { "$id": "#/items", "type": "object", @@ -95,7 +94,6 @@ "no" ] ], - "additionalItems": true, "items": { "$id": "#/items/properties/values/items", "type": "string", diff --git a/src/JDLValidations.schema.json b/src/JDLValidations.schema.json index 3ca3106..455b527 100644 --- a/src/JDLValidations.schema.json +++ b/src/JDLValidations.schema.json @@ -2,106 +2,106 @@ "$schema": "http://json-schema.org/draft-07/schema", "$id": "http://example.com/example.json", "type": "array", - "title": "The Root Schema", + "title": "The root schema", "description": "The root schema comprises the entire JSON document.", "default": [], - "additionalItems": true, - "items": { - "$id": "#/items", - "type": "object", - "title": "The Items Schema", - "description": "An explanation about the purpose of this instance.", - "default": {}, - "examples": [ + "examples": [ + [ { - "code": "UNIQUE", - "name": "unique", + "code": "REQUIRED", + "name": "required", "baseType": "BOOLEAN", "parseType": "Boolean", "valueIsRequired": false }, { - "code": "MIN", - "name": "min", - "baseType": "INTEGER", - "parseType": "Number", - "valueIsRequired": true - }, - { - "code": "PATTERN", - "name": "pattern", - "baseType": "STRING", - "parseType": "RegExp", - "valueIsRequired": true + "code": "UNIQUE", + "name": "unique", + "baseType": "BOOLEAN", + "parseType": "Boolean", + "valueIsRequired": false } - ], - "additionalProperties": true, - "required": [ - "code", - "name", - "baseType", - "parseType" - ], - "properties": { - "code": { - "$id": "#/items/properties/code", - "type": "string", - "title": "The Code Schema", - "description": "The code is the internal ID for the validation object.", - "default": "", - "examples": [ - "REQUIRED", - "MIN", - "PATTERN" - ] - }, - "name": { - "$id": "#/items/properties/name", - "type": "string", - "title": "The Name Schema", - "description": "The name is the validation's visible name.", - "default": "", - "examples": [ - "required", - "min", - "pattern" - ] - }, - "baseType": { - "$id": "#/items/properties/baseType", - "type": "string", - "title": "The baseType Schema", - "description": "The validation's baseType refers to the value type, either STRING, INTEGER or BOOLEAN.", - "default": "", - "examples": [ - "STRING", - "INTEGER", - "BOOLEAN" - ] - }, - "parseType": { - "$id": "#/items/properties/parseType", - "type": "string", - "title": "The parseType Schema", - "description": "The validation's parseType refers to what the value can be parsed to.", - "default": "", - "examples": [ - "RegExp", - "Number", - "String" - ] - }, - "valueIsRequired": { - "$id": "#/items/properties/valueIsRequired", - "type": "boolean", - "title": "The valueIsRequired Schema", - "description": "Whether the validation requires a value.", - "default": "", + ] + ], + "items": { + "$id": "#/items", + "anyOf": [ + { + "$id": "#/items/anyOf/0", + "type": "object", + "title": "The first anyOf schema", + "description": "An explanation about the purpose of this instance.", + "default": {}, "examples": [ - true, - false - ] + { + "code": "REQUIRED", + "name": "required", + "baseType": "BOOLEAN", + "parseType": "Boolean", + "valueIsRequired": false + } + ], + "required": [ + "code", + "name", + "baseType", + "parseType", + "valueIsRequired" + ], + "properties": { + "code": { + "$id": "#/items/anyOf/0/properties/code", + "type": "string", + "title": "The code schema", + "description": "An explanation about the purpose of this instance.", + "default": "", + "examples": [ + "REQUIRED" + ] + }, + "name": { + "$id": "#/items/anyOf/0/properties/name", + "type": "string", + "title": "The name schema", + "description": "An explanation about the purpose of this instance.", + "default": "", + "examples": [ + "required" + ] + }, + "baseType": { + "$id": "#/items/anyOf/0/properties/baseType", + "type": "string", + "title": "The baseType schema", + "description": "An explanation about the purpose of this instance.", + "default": "", + "examples": [ + "BOOLEAN" + ] + }, + "parseType": { + "$id": "#/items/anyOf/0/properties/parseType", + "type": "string", + "title": "The parseType schema", + "description": "An explanation about the purpose of this instance.", + "default": "", + "examples": [ + "Boolean" + ] + }, + "valueIsRequired": { + "$id": "#/items/anyOf/0/properties/valueIsRequired", + "type": "boolean", + "title": "The valueIsRequired schema", + "description": "An explanation about the purpose of this instance.", + "default": false, + "examples": [ + false + ] + } + }, + "additionalProperties": true } - } + ] } -} +} \ No newline at end of file