[Question] Extend/override properties of a parameter
See original GitHub issueHello there, I got a small question about the compoments[parameter]
Currently, im trying to make some parameters reusable and the basic seems pretty simple.
#
openapi: 3.0.1
info:
title: An include file to define common parameters
version: 1.0.0
paths:
/test:
get:
...
parameters:
- $ref: 'parameters.yml#/components/parameters/reusableParam'
...
components:
parameters:
reusableParam:
in: query
name: reusableParam
description: filter something
schema:
type: number
default: 30
Now my question is, how can I avoid to duplicate the reusableParam
if another path might need the same one but maybe with required: true
or different default: 50
what would be the “correct” way to do it?
Thank you in advance.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:78
- Comments:26 (5 by maintainers)
Top Results From Across the Web
Is it possible to override the "required" attribute of a referenced ...
As of OpenAPI 3.1, you can only override the description of a referenced parameter, but not other attributes ( required , name and...
Read more >Overloading vs. Overriding - Educative.io
Overriding occurs when two methods have the same method name and parameters. One of the methods is in the parent class, and the...
Read more >Object orientation - The Apache Groovy programming language
When the first argument is a Map, Groovy combines all named parameters into a Map (regardless of ordering) and supplies the map as...
Read more >Initialization — The Swift Programming Language (Swift 5.7)
The structure defines a single initializer, init , with no parameters, ... property rather than a variable property for the text property of...
Read more >Overriding in Java - GeeksforGeeks
Overriding and Access-Modifiers : The access modifier for an overriding method can allow more, but not less, access than the overridden method.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This would be very helpful. I’m also defining parameters which differ only with required attribute (true |false).
We’d also like to override
example
/examples
. We often have endpoints that return the same object, but the examples should be differentsee also: https://github.com/nestjs/swagger/issues/1723