Skip to content
Discussion options

You must be logged in to vote

The parameterMacro and modelPropertyMacro functions are mainly for simple default/ example overrides, not for deep context-aware logic.

  • If you don’t want to override anything, just return the original value (e.g., parameter.default for parameters, or the property object for models).
  • These macros are global, so you can’t scope them to a single path/operation/property. The function runs for every parameter/property.
  • A common pattern is:
'parameterMacro': function (operation, parameter) {
  if (parameter.name === 'year') {
    return 2025
  }
  return parameter.default // fallback to original
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by edusummit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants