elastic/kibana

[OAS] Allow custom sorting/post-processing of OAS properties generated from router

開放

#233,797 建立於 2025年9月2日

 (1 則留言) (0 個反應) (0 位負責人)TypeScript (8,021 個分叉)batch import
Feature:OASTeam:Coreenhancementgood first issue

倉庫指標

星標
 (19,065 顆星)
PR 合併指標
 (平均合併 1天 16小時) (30 天內合併 999 個 PR)

描述

The OAS converter currently emits properties in the order returned by joi-to-json, with no way to apply custom sorting for user-facing OAS docs.

Current behavior:

  • Properties appear in the order provided by joi-to-json.
  • OpenAPI/OAS has no built-in support for custom field ordering.
  • Modifying the generated YAML is possible but will be overwritten whenever the generator runs.

Possible solutions

  • Add a post-processing hook (similar to postProcessMutations in parse.ts) or an extension point (e.g., ObjectTypeOptionsMeta) so we can reorder properties in the final OAS output (not limited to alphabetical sorting).
  • Alternatively explore safe ways to modify final YAML output without being clobbered by regeneration.
  • Something completely different

References:

Expected outcome:

  • A pluggable mechanism to apply custom sorting or other transformations to generated OAS properties before writing the final spec.

貢獻者指南