-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
As discussed on the APIs You Won't Hate Slack, I've recently been trying to get an Overlay working to do endpoint-level filtering, based on the tags of the given endpoint
(Related: atamano/jsonpathly#12)
Spec:
openapi: 3.1.0
info:
title: "..."
description: "..."
version: 1.0.0
tags:
- name: Enterprise-Only
description: |
...
paths:
/metrics:
get:
operationId: getPrometheusMetrics
responses:
'200':
description: "..."
content:
text/plain:
schema:
type: string
/super/secret:
get:
tags:
- Enterprise-Only
responses:
'200':
description: "..."
content:
text/plain:
schema:
type: stringOverlay:
overlay: 1.0.0
info:
title: "..."
version: 1.0.0
actions:
# remove the tagged endpoints
# TODO doesn't work currently `[email protected]`
- target: $.paths..[?(@.tags && @.tags[*] == 'Enterprise-Only')]
remove: true
# remove the top-level tags
- target: $.tags[?(@.name == 'Enterprise-Only')]
remove: trueWhen running:
npx [email protected] overlay openapi.yml overlay.yaml
I would expect /super/secret not to exist, but it does
Metadata
Metadata
Assignees
Labels
No labels