opensearch-project / opensearch-api-specification

API specification for OpenSearch
Apache License 2.0
32 stars 48 forks source link

[BUG]Default Parameter Values Missing in Latest OpenAPI Specification #242

Closed saimedhi closed 4 months ago

saimedhi commented 5 months ago

What is the bug?

The latest OpenAPI specification lacks default parameter values.

What is the expected behavior?

Previous versions of the specification included default values for parameters in the schema.

Example: https://github.com/opensearch-project/opensearch-api-specification/blob/a44e6d92c006f1c03451a306a9e578f7ca48a862/OpenSearch.openapi.json#L485

dblock commented 5 months ago

@nhtruong or @saimedhi one of you should take it

saimedhi commented 5 months ago

@nhtruong or @saimedhi one of you should take it

nhtruong is working on this.

nhtruong commented 5 months ago

So this is what happened:

That's why those default values got lost during the translation. I'm going to compare the 2 sets of schemas to find the missing defaults. One thing to keep in mind: OpenAPI does not natively support default property inside a Parameter Object. That is, parameters pointing to the same schema cannot have their own default values but rather a shared default value via the shared schema. I've seen virtually identical parameters that only differ in the default values before. So, we will have to introduce another extension, x-default, for parameter objects.