Description
For the AdditionalProperties
and AdditionalProperty
behaviors some code generators may need additional information to produce synthetic fields like:
- a map/dictionary holding additional properties
- two fields used to capture the key and value of a single key dictionary.
Additionally these fields need to have some associated documentation explaining their purpose.
For reference, here is below the built-in configuration used by the Java generator.
-
Additional properties behavior:
The configuration is defined for every type that implements
AdditionalProperties
and provides the map/dict field name to generate and its description.This could be captured in the API spec using a new annotation such as (using the first row of the table)
@additional_properties metadata Additional detail about the error
although the tag name seems redundant withimplements AdditionalProperties<...>
.Type dict field name description ErrorCause metadata Additional details about the error InlineGet metadata Document metadata InferenceAggregate data Additional data MultiBucketBase aggregations Nested aggregations SingleBucketAggregateBase aggregations Nested aggregations SortContainer fields Field sort criteria Jobs jobs Detailed job data Suggester suggesters The named suggesters FieldsUsageBody stats Per index statistics ExplainAnalyzeToken attributes Additional tokenizer-specific attributes IndexSettings other_settings Additional settings not covered in this type. Unless these settings are defined by a plugin, please open an issue on the Elasticsearch API specification so that they can be added in a future release. DocumentSimulation metadata Additional metadata SourceRepositorySettings settings Additional settings NodeInfoDiscover settings Additional or alternative settings -
Additional property behavior:
The configuration defines a field name for types that are used either as the key or the value of a
AdditionalProperty
behavior. In the table below the types used as key are in bold. We currently don't have descriptions for them.This could be captured in the model using a new annotation
@additional_property bounding_box The bounding box
. There is no redundancy as in additional properties since it is added to types used either as key or value.Type field name description BoundingBox bounding_box GeoBounds bounding_box GeoLocation location GeoPolygonPoints polygon GeoShapeFieldQuery shape ShapeFieldQuery shape Field field FieldSort sort TermsQueryField terms ConditionOp operator CompareParams params ArrayCompareParams params ArrayCompareOpParams params FieldValue value NodeId node_id DecayPlacement placement ShardStoreNode node