Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture information for additional propert(y|ies) behavior #2832

Open
swallez opened this issue Aug 29, 2024 · 0 comments
Open

Capture information for additional propert(y|ies) behavior #2832

swallez opened this issue Aug 29, 2024 · 0 comments

Comments

@swallez
Copy link
Member

swallez commented Aug 29, 2024

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 with implements 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant