ENHANCEMENT: extend components section for all allowed types
it would be nice to be able to define all reusable components (parameters, responses ..) in the components section
and make it possible to reference them ... maybe like parameterRef("myParam")
would that be a useful feature?
Hi bitkid,
thanks four your issue.
can you please provide a bit more information? How should it look in the code? I must admit, that I currently not creating OAS3 Apis often. I'm also open to merge a PR.
i use something along these lines .. not sure if its worth a PR
fun Components.parameter(init: Parameter.() -> Unit) { val parameter = Parameter() parameter.init() if (parameter.name.isNullOrBlank()) error("parameter name has to be set") addParameters(parameter.name, parameter) }
fun Operation.parameterRef(name: String) {
addParametersItem(Parameter().apply { $ref = name })
}