Skip to content

Commit e02c076

Browse files
authored
Filled in Missing Defaults (#249)
* Filled in Missing Defaults Signed-off-by: Theo Truong <theotr@amazon.com> * # Wordings Signed-off-by: Theo Truong <theotr@amazon.com> --------- Signed-off-by: Theo Truong <theotr@amazon.com>
1 parent fe6f977 commit e02c076

10 files changed

Lines changed: 162 additions & 0 deletions

File tree

CLIENT_GENERATOR_GUIDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ Some operations accept a bulk of data in the request body. For example, the `bul
5252
As of right now, most clients only validate whether required parameters are present. The clients do not validate the values of parameters against the enum values or regex patterns. This is to reduce performance overhead for the clients as the validation is already done on the server. However, the list of enum values and regex patterns are often written into the parameter description.
5353

5454
Some clients also check for the validity of query string parameter names to guard the users from typos. If you decide to implement this feature, make sure that it's performant. Scripting languages like Python and Ruby require the code to be loaded into memory at runtime, and constructs used for this feature can be expensive to load, as far as micro-services are concerned.
55+
56+
## Global Parameters
57+
All operations in the spec contain a set of parameters that are common across all operations. These parameters are denoted with `x-global: true` vendor extension. The generated clients should find a way to DRY these parameters.
58+
59+
## Default Parameter Values
60+
Parameters can have default values either through schema or the `x-default` vendor extension. When both are present, `x-default` will takes precedence.

DEVELOPER_GUIDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ This repository includes several penAPI Specification Extensions to fill in any
8282
- `x-deprecation-message`: Reason for deprecation and guidance on how to prepare for the next major version.
8383
- `x-ignorable`: Denotes that the operation should be ignored by the client generator. This is used in operation groups where some operations have been replaced by newer ones, but we still keep them in the specs because the server still supports them.
8484
- `x-global`: Denotes that the parameter is a global parameter that is included in every operation. These parameters are listed in the [root file](spec/opensearch-openapi.yaml).
85+
- `x-default`: Contains the default value of a parameter. This is often used to override the default value specified in the schema, or to avoid accidentally changing the default value when updating a shared schema.
8586

8687
## Linting
8788
We have a linter that validates every `yaml` file in the `./spec` folder to assure that they follow the guidelines we have set. Check out the [Linter](tools/README.md#linter) tool for more information on how to run it locally. Make sure to run the linter before submitting a PR.

0 commit comments

Comments
 (0)