From 1285ddb19c0c895937cfe003b2b40ef39118045d Mon Sep 17 00:00:00 2001 From: Tokesh Date: Thu, 6 Feb 2025 08:04:51 +0500 Subject: [PATCH 1/2] feat: testing add vale rule Signed-off-by: Tokesh --- .github/vale/styles/OpenSearch/NumericFormat.yml | 0 .vale.ini | 1 + spec/namespaces/_core.yaml | 1 + 3 files changed, 2 insertions(+) create mode 100644 .github/vale/styles/OpenSearch/NumericFormat.yml diff --git a/.github/vale/styles/OpenSearch/NumericFormat.yml b/.github/vale/styles/OpenSearch/NumericFormat.yml new file mode 100644 index 000000000..e69de29bb diff --git a/.vale.ini b/.vale.ini index 9141bb025..b14b6f078 100644 --- a/.vale.ini +++ b/.vale.ini @@ -25,6 +25,7 @@ OpenSearch.LoginNoun = YES OpenSearch.LoginVerb = YES OpenSearch.LogoutNoun = YES OpenSearch.LogoutVerb = YES +OpenSearch.NumericFormat = YES OpenSearch.OxfordComma = YES OpenSearch.PassiveVoice = NO OpenSearch.Please = YES diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index 7e8bcc884..1b463ab0a 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -2273,6 +2273,7 @@ components: - $ref: '../schemas/_core.bulk.yaml#/components/schemas/OperationContainer' - $ref: '../schemas/_core.bulk.yaml#/components/schemas/UpdateAction' - type: object + - type: number description: The operation definition and data (action-data pairs), separated by newlines required: true bulk_stream: From 5541725e4a7bec2c6c9b0b609ca3b682ebf76a30 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Thu, 6 Feb 2025 08:07:22 +0500 Subject: [PATCH 2/2] added: vale yml and changelog Signed-off-by: Tokesh --- .github/vale/styles/OpenSearch/NumericFormat.yml | 14 ++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 15 insertions(+) diff --git a/.github/vale/styles/OpenSearch/NumericFormat.yml b/.github/vale/styles/OpenSearch/NumericFormat.yml index e69de29bb..c32e5d22e 100644 --- a/.github/vale/styles/OpenSearch/NumericFormat.yml +++ b/.github/vale/styles/OpenSearch/NumericFormat.yml @@ -0,0 +1,14 @@ +extends: existence +message: "Schema of type 'number' must specify a 'format'." +link: https://github.com/opensearch-project/documentation-website/blob/main/TERMS.md +ignorecase: true +level: warning +action: + name: remove +tokens: + - type: number +patterns: + - pattern: 'type: number' + next_line: + - pattern: 'format:' + negate: true diff --git a/CHANGELOG.md b/CHANGELOG.md index e42ff3447..19a7068c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `GET`, `POST /_plugins/_ml/tasks/_search`, `GET /_plugins/_ml/tools`, `tools/{tool_name}` ([#797](https://github.com/opensearch-project/opensearch-api-specification/pull/797)) - Added `POST /_plugins/_ml/agents/{agent_id}/_execute`, `GET /_plugins/_ml/agents/{agent_id}`, `GET`, `POST /_plugins/_ml/agents/_search` ([#798](https://github.com/opensearch-project/opensearch-api-specification/pull/798)) - Added a warning for test file names that don't match the API being tested ([#793](https://github.com/opensearch-project/opensearch-api-specification/pull/793)) +- Added a vale rule for numeric types ([#800](https://github.com/opensearch-project/opensearch-api-specification/pull/800)) - Added `time` field to the `GetStats` schema in `_common.yml` ([#803](https://github.com/opensearch-project/opensearch-api-specification/pull/803)) - Added version for `POST /_plugins/_ml/_train/{algorithm_name}`, `_predict/{algorithm_name}/{model_id}`, and `_train_predict/{algorithm_name}` ([#763](https://github.com/opensearch-project/opensearch-api-specification/pull/763)) - Added `POST _plugins/_security/api/internalusers/{username}` response `201` ([#810](https://github.com/opensearch-project/opensearch-api-specification/pull/810))