From d0c9fbd1269e683357082651aa2451f355b1c244 Mon Sep 17 00:00:00 2001 From: Rodge Fu Date: Mon, 2 Mar 2020 10:35:10 +0800 Subject: [PATCH] add short-cut action for 'required' --- README.md | 7 +++++-- src/plugins/modifier/cliDirectiveAction.ts | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ee2e6a1..986acc4 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,9 @@ clicommon: - remove: - add 'remove: ...' under 'language->cli'. - optional +- required: + - add 'required: ...' under 'language->cli'. + - optional - alias: - add 'alias: ...' under 'language->cli' - optional @@ -192,7 +195,7 @@ clicommon: output-artifact: - clicommon-output-file ``` -- File 'code-model-v4-cli-simplified.yaml' will be generated containing the simplified code model which can be looked up for the name of operationGroup, operation, parameter, schema, property, enum, enumValue +- File 'clicommon-name-mapping.yaml' will be generated containing the simplified code model which can be looked up for the name of operationGroup, operation, parameter, schema, property, enum, enumValue #### Samples @@ -229,7 +232,7 @@ clicommon: group: 'group_name' op: 'operation_name' param: 'parameter_name' - remove: true + required: true # add hide property for all parameter start with 'abc' - where: parameter: '^abc.*$' diff --git a/src/plugins/modifier/cliDirectiveAction.ts b/src/plugins/modifier/cliDirectiveAction.ts index 3f4bce5..a97e3fd 100644 --- a/src/plugins/modifier/cliDirectiveAction.ts +++ b/src/plugins/modifier/cliDirectiveAction.ts @@ -40,6 +40,7 @@ export abstract class Action { break; case 'hide': case 'remove': + case 'required': arr.push(new ActionSetProperty(value, key, () => true)); break; case 'name':