You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openapi: 3.0.1info:
title: Datasource APIdescription: API to work with Datasources.termsOfService: 'urn:tos'''paths:
/timeseries:
get:
operationId: searchTimeSeriesDefinitionssummary: Search the time series definitionsparameters:
- name: searchPatternin: querydescription: Pattern to search time series definitions. Cannot be used at the same time as name parameter.required: falseschema:
type: string
overlays.yaml
overlay: 1.0.0info:
title: Structured Overlayversion: 1.0.0actions:
- target: "$"# Root of documentupdate:
paths:
/timeseries:
get:
description: Retrieve a list of all time series definitions. This endpoint supports search and pagination.parameters:
- name: searchPatternin: querydescription: A pattern used to search time series definitions.schema:
example: temp-
paths:
/timeseries:
get:
operationId: searchTimeSeriesDefinitionssummary: Search the time series definitionsdescription: Retrieve a list of all time series definitions. This endpoint supports search and pagination.parameters:
- name: searchPatternin: querydescription: Pattern to search time series definitions. Cannot be used at the same time as name parameter.required: falseschema:
type: string
- name: searchPatternin: querydescription: A pattern used to search time series definitions.schema:
example: temp*
Expected result
paths:
/timeseries:
get:
operationId: searchTimeSeriesDefinitionssummary: Search the time series definitionsdescription: Retrieve a list of all time series definitions. This endpoint supports search and pagination.parameters:
- name: searchPatternin: querydescription: A pattern used to search time series definitions.required: falseschema:
type: stringexample: temp-
The text was updated successfully, but these errors were encountered:
I think, it would make sense to provide an explicit merge instruction for the "parameters".
This will handle that the parameters are merged intelligently by checking for existing parameters with the same name and path location (in: query in this case)
Something like this?
jsonpath.apply(spec, target, (chunk) => {
if (typeof chunk === 'object' && typeof action.update === 'object') {
if (Array.isArray(chunk) && Array.isArray(action.update)) {
// Handle array merging carefully to avoid duplicating parameters
if (target.includes('parameters')) {
// Merge the parameters array by checking if parameter already exists
const mergedParameters = [...chunk];
action.update.forEach((newParam: any) => {
const existingParamIndex = mergedParameters.findIndex(
(p: any) => p.name === newParam.name && p.in === newParam.in
);
if (existingParamIndex > -1) {
// Update the existing parameter
mergedParameters[existingParamIndex] = merger(mergedParameters[existingParamIndex], newParam);
} else {
// Add the new parameter if it doesn't exist
mergedParameters.push(newParam);
}
});
return mergedParameters;
} else {
// For arrays that are not parameters, just concatenate
return chunk.concat(action.update);
}
} else {
return merger(chunk, action.update);
}
} else {
return action.update;
}
});
Steps to reproduce
Openapi.yaml
overlays.yaml
execute:
bump overlay openapi.yaml overlays.yaml > openapi.public.yam
lResult in:
Expected result
The text was updated successfully, but these errors were encountered: