-
Notifications
You must be signed in to change notification settings - Fork 115
Add media types #5779
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
Add media types #5779
Conversation
They come from the rest-api-spec.
|
Following you can find the validation changes against the target branch for the APIs. No changes detected. You can validate these APIs yourself by using the |
|
It would be great to ultimately have those |
Do you mean |
|
Right, parsing unions as strings feels wrong. I would rather use the AST if possible. 🤷 |
|
I took a jab at using more the AST. |
pquentin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM.
Anaethelion
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.19 8.19
# Navigate to the new working tree
cd .worktrees/backport-8.19
# Create a new branch
git switch --create backport-5779-to-8.19
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8260d402ec3ef0dfdf86a88736c190016f1adbad
# Push it to GitHub
git push --set-upstream origin backport-5779-to-8.19
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.19Then, create a pull request where the |
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-9.1 9.1
# Navigate to the new working tree
cd .worktrees/backport-9.1
# Create a new branch
git switch --create backport-5779-to-9.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8260d402ec3ef0dfdf86a88736c190016f1adbad
# Push it to GitHub
git push --set-upstream origin backport-5779-to-9.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-9.1Then, create a pull request where the |
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-9.2 9.2
# Navigate to the new working tree
cd .worktrees/backport-9.2
# Create a new branch
git switch --create backport-5779-to-9.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8260d402ec3ef0dfdf86a88736c190016f1adbad
# Push it to GitHub
git push --set-upstream origin backport-5779-to-9.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-9.2Then, create a pull request where the |
* Add media types to specification They come from the rest-api-spec. * Support mediaType * Fix lint * Fix compiler lint * Use string values for enums * Take advantage of the AST and use enums text values * Fix linter * Run make spec-format-fix * Add recursive enum parsing to handle meta members * Add const to highlight enum target name * Remove support for composite enums * Add more media types --------- Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co> (cherry picked from commit 8260d40) # Conflicts: # output/schema/schema.json # specification/_global/rank_eval/RankEvalRequest.ts # specification/_global/terms_enum/TermsEnumRequest.ts # specification/cat/circuit_breaker/CatCircuitBreakerRequest.ts # specification/cluster/reroute/ClusterRerouteRequest.ts # specification/cluster/state/ClusterStateRequest.ts # specification/indices/add_block/IndicesAddBlockRequest.ts # specification/indices/data_streams_stats/IndicesDataStreamsStatsRequest.ts # specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts # specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts # specification/indices/get_sample/GetRandomSampleRequest.ts # specification/indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts # specification/indices/get_sample_stats/GetRandomSampleStatsRequest.ts # specification/indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts # specification/indices/remove_block/IndicesRemoveBlockRequest.ts # specification/indices/stats/IndicesStatsRequest.ts # specification/inference/put_openshift_ai/PutOpenShiftAiRequest.ts # specification/inference/rerank/RerankRequest.ts # specification/ingest/put_pipeline/PutPipelineRequest.ts # specification/nodes/info/NodesInfoRequest.ts # specification/nodes/stats/NodesStatsRequest.ts # specification/nodes/usage/NodesUsageRequest.ts # specification/project/tags/TagsRequest.ts # specification/security/clear_cached_privileges/SecurityClearCachedPrivilegesRequest.ts # specification/snapshot/delete/SnapshotDeleteRequest.ts
* Add media types to specification They come from the rest-api-spec. * Support mediaType * Fix lint * Fix compiler lint * Use string values for enums * Take advantage of the AST and use enums text values * Fix linter * Run make spec-format-fix * Add recursive enum parsing to handle meta members * Add const to highlight enum target name * Remove support for composite enums * Add more media types --------- Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co> (cherry picked from commit 8260d40) # Conflicts: # output/schema/schema.json # specification/_global/clear_scroll/ClearScrollRequest.ts # specification/_global/count/CountRequest.ts # specification/_global/field_caps/FieldCapabilitiesRequest.ts # specification/_global/msearch/MultiSearchRequest.ts # specification/_global/msearch_template/MultiSearchTemplateRequest.ts # specification/_global/open_point_in_time/OpenPointInTimeRequest.ts # specification/_global/rank_eval/RankEvalRequest.ts # specification/_global/search/SearchRequest.ts # specification/_global/search_mvt/SearchMvtRequest.ts # specification/_global/search_template/SearchTemplateRequest.ts # specification/_global/terms_enum/TermsEnumRequest.ts # specification/_types/common.ts # specification/async_search/submit/AsyncSearchSubmitRequest.ts # specification/cat/circuit_breaker/CatCircuitBreakerRequest.ts # specification/cat/count/CatCountRequest.ts # specification/cluster/allocation_explain/ClusterAllocationExplainRequest.ts # specification/cluster/reroute/ClusterRerouteRequest.ts # specification/cluster/state/ClusterStateRequest.ts # specification/eql/search/EqlSearchRequest.ts # specification/esql/query/QueryRequest.ts # specification/indices/add_block/IndicesAddBlockRequest.ts # specification/indices/data_streams_stats/IndicesDataStreamsStatsRequest.ts # specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts # specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts # specification/indices/get_data_stream_mappings/IndicesGetDataStreamMappingsRequest.ts # specification/indices/get_sample/GetRandomSampleRequest.ts # specification/indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts # specification/indices/get_sample_stats/GetRandomSampleStatsRequest.ts # specification/indices/put_data_stream_mappings/IndicesPutDataStreamMappingsRequest.ts # specification/indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts # specification/indices/remove_block/IndicesRemoveBlockRequest.ts # specification/indices/resolve_index/ResolveIndexRequest.ts # specification/indices/stats/IndicesStatsRequest.ts # specification/inference/put_ai21/PutAi21Request.ts # specification/inference/put_contextualai/PutContextualAiRequest.ts # specification/inference/put_llama/PutLlamaRequest.ts # specification/inference/put_openshift_ai/PutOpenShiftAiRequest.ts # specification/inference/rerank/RerankRequest.ts # specification/ingest/put_pipeline/PutPipelineRequest.ts # specification/nodes/info/NodesInfoRequest.ts # specification/nodes/stats/NodesStatsRequest.ts # specification/nodes/usage/NodesUsageRequest.ts # specification/project/tags/TagsRequest.ts # specification/security/clear_cached_privileges/SecurityClearCachedPrivilegesRequest.ts # specification/security/get_stats/SecurityStatsRequest.ts # specification/snapshot/delete/SnapshotDeleteRequest.ts # specification/sql/query/QuerySqlRequest.ts # specification/streams/status/StreamsStatusRequest.ts
* Add media types to specification They come from the rest-api-spec. * Support mediaType * Fix lint * Fix compiler lint * Use string values for enums * Take advantage of the AST and use enums text values * Fix linter * Run make spec-format-fix * Add recursive enum parsing to handle meta members * Add const to highlight enum target name * Remove support for composite enums * Add more media types --------- Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co> (cherry picked from commit 8260d40) # Conflicts: # output/schema/schema.json # output/schema/validation-errors.json # specification/_global/count/CountRequest.ts # specification/_global/field_caps/FieldCapabilitiesRequest.ts # specification/_global/msearch/MultiSearchRequest.ts # specification/_global/msearch_template/MultiSearchTemplateRequest.ts # specification/_global/open_point_in_time/OpenPointInTimeRequest.ts # specification/_global/rank_eval/RankEvalRequest.ts # specification/_global/render_search_template/RenderSearchTemplateRequest.ts # specification/_global/search/SearchRequest.ts # specification/_global/search_mvt/SearchMvtRequest.ts # specification/_global/search_template/SearchTemplateRequest.ts # specification/_global/terms_enum/TermsEnumRequest.ts # specification/_types/common.ts # specification/async_search/submit/AsyncSearchSubmitRequest.ts # specification/cat/aliases/CatAliasesRequest.ts # specification/cat/circuit_breaker/CatCircuitBreakerRequest.ts # specification/cat/count/CatCountRequest.ts # specification/cat/health/CatHealthRequest.ts # specification/cluster/allocation_explain/ClusterAllocationExplainRequest.ts # specification/cluster/reroute/ClusterRerouteRequest.ts # specification/cluster/state/ClusterStateRequest.ts # specification/connector/get/ConnectorGetRequest.ts # specification/eql/search/EqlSearchRequest.ts # specification/esql/async_query/AsyncQueryRequest.ts # specification/esql/get_query/GetQueryRequest.ts # specification/esql/list_queries/ListQueriesRequest.ts # specification/esql/query/QueryRequest.ts # specification/ilm/migrate_to_data_tiers/Request.ts # specification/indices/add_block/IndicesAddBlockRequest.ts # specification/indices/data_streams_stats/IndicesDataStreamsStatsRequest.ts # specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts # specification/indices/exists_alias/IndicesExistsAliasRequest.ts # specification/indices/get_alias/IndicesGetAliasRequest.ts # specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts # specification/indices/get_data_stream_mappings/IndicesGetDataStreamMappingsRequest.ts # specification/indices/get_sample/GetRandomSampleRequest.ts # specification/indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts # specification/indices/get_sample_stats/GetRandomSampleStatsRequest.ts # specification/indices/migrate_reindex/MigrateReindexRequest.ts # specification/indices/put_data_stream_mappings/IndicesPutDataStreamMappingsRequest.ts # specification/indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts # specification/indices/resolve_index/ResolveIndexRequest.ts # specification/indices/stats/IndicesStatsRequest.ts # specification/indices/unfreeze/IndicesUnfreezeRequest.ts # specification/indices/unfreeze/IndicesUnfreezeResponse.ts # specification/inference/put_ai21/PutAi21Request.ts # specification/inference/put_contextualai/PutContextualAiRequest.ts # specification/inference/put_llama/PutLlamaRequest.ts # specification/inference/put_openshift_ai/PutOpenShiftAiRequest.ts # specification/inference/rerank/RerankRequest.ts # specification/ingest/put_pipeline/PutPipelineRequest.ts # specification/nodes/info/NodesInfoRequest.ts # specification/nodes/stats/NodesStatsRequest.ts # specification/nodes/usage/NodesUsageRequest.ts # specification/project/tags/TagsRequest.ts # specification/security/clear_cached_privileges/SecurityClearCachedPrivilegesRequest.ts # specification/snapshot/delete/SnapshotDeleteRequest.ts # specification/sql/query/QuerySqlRequest.ts # specification/synonyms/delete_synonym_rule/SynonymRuleDeleteRequest.ts # validator/rules/no-inline-unions.js # validator/test/no-inline-unions.test.js
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
* Add media types to specification They come from the rest-api-spec. * Support mediaType * Fix lint * Fix compiler lint * Use string values for enums * Take advantage of the AST and use enums text values * Fix linter * Run make spec-format-fix * Add recursive enum parsing to handle meta members * Add const to highlight enum target name * Remove support for composite enums * Add more media types --------- Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co> (cherry picked from commit 8260d40) # Conflicts: # output/schema/schema.json # specification/_global/rank_eval/RankEvalRequest.ts # specification/_global/terms_enum/TermsEnumRequest.ts # specification/cat/circuit_breaker/CatCircuitBreakerRequest.ts # specification/cluster/reroute/ClusterRerouteRequest.ts # specification/cluster/state/ClusterStateRequest.ts # specification/indices/add_block/IndicesAddBlockRequest.ts # specification/indices/data_streams_stats/IndicesDataStreamsStatsRequest.ts # specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts # specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts # specification/indices/get_sample/GetRandomSampleRequest.ts # specification/indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts # specification/indices/get_sample_stats/GetRandomSampleStatsRequest.ts # specification/indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts # specification/indices/remove_block/IndicesRemoveBlockRequest.ts # specification/indices/stats/IndicesStatsRequest.ts # specification/inference/put_openshift_ai/PutOpenShiftAiRequest.ts # specification/inference/rerank/RerankRequest.ts # specification/ingest/put_pipeline/PutPipelineRequest.ts # specification/nodes/info/NodesInfoRequest.ts # specification/nodes/stats/NodesStatsRequest.ts # specification/nodes/usage/NodesUsageRequest.ts # specification/project/tags/TagsRequest.ts # specification/security/clear_cached_privileges/SecurityClearCachedPrivilegesRequest.ts # specification/snapshot/delete/SnapshotDeleteRequest.ts
* Add media types to specification They come from the rest-api-spec. * Support mediaType * Fix lint * Fix compiler lint * Use string values for enums * Take advantage of the AST and use enums text values * Fix linter * Run make spec-format-fix * Add recursive enum parsing to handle meta members * Add const to highlight enum target name * Remove support for composite enums * Add more media types --------- Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co> (cherry picked from commit 8260d40) # Conflicts: # output/schema/schema.json # specification/_global/clear_scroll/ClearScrollRequest.ts # specification/_global/count/CountRequest.ts # specification/_global/field_caps/FieldCapabilitiesRequest.ts # specification/_global/msearch/MultiSearchRequest.ts # specification/_global/msearch_template/MultiSearchTemplateRequest.ts # specification/_global/open_point_in_time/OpenPointInTimeRequest.ts # specification/_global/rank_eval/RankEvalRequest.ts # specification/_global/search/SearchRequest.ts # specification/_global/search_mvt/SearchMvtRequest.ts # specification/_global/search_template/SearchTemplateRequest.ts # specification/_global/terms_enum/TermsEnumRequest.ts # specification/_types/common.ts # specification/async_search/submit/AsyncSearchSubmitRequest.ts # specification/cat/circuit_breaker/CatCircuitBreakerRequest.ts # specification/cat/count/CatCountRequest.ts # specification/cluster/allocation_explain/ClusterAllocationExplainRequest.ts # specification/cluster/reroute/ClusterRerouteRequest.ts # specification/cluster/state/ClusterStateRequest.ts # specification/eql/search/EqlSearchRequest.ts # specification/esql/query/QueryRequest.ts # specification/indices/add_block/IndicesAddBlockRequest.ts # specification/indices/data_streams_stats/IndicesDataStreamsStatsRequest.ts # specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts # specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts # specification/indices/get_data_stream_mappings/IndicesGetDataStreamMappingsRequest.ts # specification/indices/get_sample/GetRandomSampleRequest.ts # specification/indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts # specification/indices/get_sample_stats/GetRandomSampleStatsRequest.ts # specification/indices/put_data_stream_mappings/IndicesPutDataStreamMappingsRequest.ts # specification/indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts # specification/indices/remove_block/IndicesRemoveBlockRequest.ts # specification/indices/resolve_index/ResolveIndexRequest.ts # specification/indices/stats/IndicesStatsRequest.ts # specification/inference/put_ai21/PutAi21Request.ts # specification/inference/put_contextualai/PutContextualAiRequest.ts # specification/inference/put_llama/PutLlamaRequest.ts # specification/inference/put_openshift_ai/PutOpenShiftAiRequest.ts # specification/inference/rerank/RerankRequest.ts # specification/ingest/put_pipeline/PutPipelineRequest.ts # specification/nodes/info/NodesInfoRequest.ts # specification/nodes/stats/NodesStatsRequest.ts # specification/nodes/usage/NodesUsageRequest.ts # specification/project/tags/TagsRequest.ts # specification/security/clear_cached_privileges/SecurityClearCachedPrivilegesRequest.ts # specification/security/get_stats/SecurityStatsRequest.ts # specification/snapshot/delete/SnapshotDeleteRequest.ts # specification/sql/query/QuerySqlRequest.ts # specification/streams/status/StreamsStatusRequest.ts
* Add media types to specification They come from the rest-api-spec. * Support mediaType * Fix lint * Fix compiler lint * Use string values for enums * Take advantage of the AST and use enums text values * Fix linter * Run make spec-format-fix * Add recursive enum parsing to handle meta members * Add const to highlight enum target name * Remove support for composite enums * Add more media types --------- Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co> (cherry picked from commit 8260d40) # Conflicts: # output/schema/schema.json # output/schema/validation-errors.json # specification/_global/count/CountRequest.ts # specification/_global/field_caps/FieldCapabilitiesRequest.ts # specification/_global/msearch/MultiSearchRequest.ts # specification/_global/msearch_template/MultiSearchTemplateRequest.ts # specification/_global/open_point_in_time/OpenPointInTimeRequest.ts # specification/_global/rank_eval/RankEvalRequest.ts # specification/_global/render_search_template/RenderSearchTemplateRequest.ts # specification/_global/search/SearchRequest.ts # specification/_global/search_mvt/SearchMvtRequest.ts # specification/_global/search_template/SearchTemplateRequest.ts # specification/_global/terms_enum/TermsEnumRequest.ts # specification/_types/common.ts # specification/async_search/submit/AsyncSearchSubmitRequest.ts # specification/cat/aliases/CatAliasesRequest.ts # specification/cat/circuit_breaker/CatCircuitBreakerRequest.ts # specification/cat/count/CatCountRequest.ts # specification/cat/health/CatHealthRequest.ts # specification/cluster/allocation_explain/ClusterAllocationExplainRequest.ts # specification/cluster/reroute/ClusterRerouteRequest.ts # specification/cluster/state/ClusterStateRequest.ts # specification/connector/get/ConnectorGetRequest.ts # specification/eql/search/EqlSearchRequest.ts # specification/esql/async_query/AsyncQueryRequest.ts # specification/esql/get_query/GetQueryRequest.ts # specification/esql/list_queries/ListQueriesRequest.ts # specification/esql/query/QueryRequest.ts # specification/ilm/migrate_to_data_tiers/Request.ts # specification/indices/add_block/IndicesAddBlockRequest.ts # specification/indices/data_streams_stats/IndicesDataStreamsStatsRequest.ts # specification/indices/delete_sample_configuration/IndicesDeleteSampleConfigurationRequest.ts # specification/indices/exists_alias/IndicesExistsAliasRequest.ts # specification/indices/get_alias/IndicesGetAliasRequest.ts # specification/indices/get_all_sample_configuration/IndicesGetAllSampleConfigurationRequest.ts # specification/indices/get_data_stream_mappings/IndicesGetDataStreamMappingsRequest.ts # specification/indices/get_sample/GetRandomSampleRequest.ts # specification/indices/get_sample_configuration/IndicesGetSampleConfigurationRequest.ts # specification/indices/get_sample_stats/GetRandomSampleStatsRequest.ts # specification/indices/migrate_reindex/MigrateReindexRequest.ts # specification/indices/put_data_stream_mappings/IndicesPutDataStreamMappingsRequest.ts # specification/indices/put_sample_configuration/IndicesPutSampleConfigurationRequest.ts # specification/indices/resolve_index/ResolveIndexRequest.ts # specification/indices/stats/IndicesStatsRequest.ts # specification/indices/unfreeze/IndicesUnfreezeRequest.ts # specification/indices/unfreeze/IndicesUnfreezeResponse.ts # specification/inference/put_ai21/PutAi21Request.ts # specification/inference/put_contextualai/PutContextualAiRequest.ts # specification/inference/put_llama/PutLlamaRequest.ts # specification/inference/put_openshift_ai/PutOpenShiftAiRequest.ts # specification/inference/rerank/RerankRequest.ts # specification/ingest/put_pipeline/PutPipelineRequest.ts # specification/nodes/info/NodesInfoRequest.ts # specification/nodes/stats/NodesStatsRequest.ts # specification/nodes/usage/NodesUsageRequest.ts # specification/project/tags/TagsRequest.ts # specification/security/clear_cached_privileges/SecurityClearCachedPrivilegesRequest.ts # specification/snapshot/delete/SnapshotDeleteRequest.ts # specification/sql/query/QuerySqlRequest.ts # specification/synonyms/delete_synonym_rule/SynonymRuleDeleteRequest.ts # validator/rules/no-inline-unions.js # validator/test/no-inline-unions.test.js
As decided offline:
request_media_type/response_media_typekeys, as done for URLsThis works, as shown by the unchanged schema.json. However, the way I'm getting the
request_media_typeandresponse_media_typevalues is ugly, and I would appreciate a better solution here.Closes #297