From fc4e07578d315066421463da5452ca855813a55c Mon Sep 17 00:00:00 2001 From: Mike Kistler Date: Wed, 29 Jan 2025 13:08:40 -0600 Subject: [PATCH 1/3] Fixes examples for compliance with RFC-9535 --- src/overlay.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/overlay.md b/src/overlay.md index fa577f6..a0d1fad 100644 --- a/src/overlay.md +++ b/src/overlay.md @@ -212,8 +212,8 @@ info: actions: - target: $.paths.*.get.parameters update: - name: newParam - in: query + - name: newParam + in: query ``` ```yaml @@ -238,7 +238,7 @@ info: paths: /items: get: - x-oai-traits: ['paged'] + x-oai-paged: true responses: 200: description: OK @@ -252,15 +252,16 @@ info: title: Apply Traits version: 1.0.0 actions: - - target: $.paths.*.get[?@.x-oai-traits.paged] + - target: $.paths[?@.get && @.get['x-oai-paged']] update: - parameters: - - name: top - in: query - # ... - - name: skip - in: query - # ... + get: + parameters: + - name: top + in: query + # ... + - name: skip + in: query + # ... ``` This approach allows inversion of control as to where the Overlay updates apply to the target document itself. From 96cf4c284d2f2f66b49feb7ea4296357dee561a0 Mon Sep 17 00:00:00 2001 From: Mike Kistler Date: Tue, 11 Feb 2025 10:28:39 -0600 Subject: [PATCH 2/3] Address PR review comments --- src/overlay.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/overlay.md b/src/overlay.md index a0d1fad..98dd247 100644 --- a/src/overlay.md +++ b/src/overlay.md @@ -252,16 +252,15 @@ info: title: Apply Traits version: 1.0.0 actions: - - target: $.paths[?@.get && @.get['x-oai-paged']] + - target: $.paths[?@.get['x-oai-paged']].get update: - get: - parameters: - - name: top - in: query - # ... - - name: skip - in: query - # ... + parameters: + - name: top + in: query + # ... + - name: skip + in: query + # ... ``` This approach allows inversion of control as to where the Overlay updates apply to the target document itself. From 24391cae561866662e1d5d6802f1476e197fc3ed Mon Sep 17 00:00:00 2001 From: Mike Kistler Date: Tue, 11 Feb 2025 20:59:26 -0600 Subject: [PATCH 3/3] Revert change to x-oai-traits --- src/overlay.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/overlay.md b/src/overlay.md index 98dd247..7a7e613 100644 --- a/src/overlay.md +++ b/src/overlay.md @@ -238,7 +238,7 @@ info: paths: /items: get: - x-oai-paged: true + x-oai-traits: ['paged'] responses: 200: description: OK @@ -252,7 +252,7 @@ info: title: Apply Traits version: 1.0.0 actions: - - target: $.paths[?@.get['x-oai-paged']].get + - target: $.paths[?@.get['x-oai-traits'][?@ == 'paged']].get update: parameters: - name: top