From 07b6d7058ba2d3340473f120b425c2fc35dddb89 Mon Sep 17 00:00:00 2001 From: davisagli Date: Thu, 21 Sep 2023 14:11:39 -0700 Subject: [PATCH] [fc] Repository: plone.restapi Branch: refs/heads/main Date: 2023-09-21T14:11:39-07:00 Author: Timo Stollenwerk (tisto) Commit: https://github.com/plone/plone.restapi/commit/863d9a20ce22e63843848a76ffcde5c139674be5 Undeprecate comma-separated list of expansion (#1707) Files changed: A news/1696.bugfix M src/plone/restapi/serializer/expansion.py --- last_commit.txt | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 7d8bcb3e0e..3ade669126 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -2,36 +2,15 @@ Repository: plone.restapi Branch: refs/heads/main -Date: 2023-09-21T13:44:51-07:00 -Author: David Glick (davisagli) -Commit: https://github.com/plone/plone.restapi/commit/8e2786a656f4b16868efe562f26acbd13cde1fa7 +Date: 2023-09-21T14:11:39-07:00 +Author: Timo Stollenwerk (tisto) +Commit: https://github.com/plone/plone.restapi/commit/863d9a20ce22e63843848a76ffcde5c139674be5 -Support getting /@querystring vocabs in context (#1704) - -* Support getting /@querystring vocabs in context - -* changelog - -* Add test, update docs - -* Update docs/source/endpoints/querystring.md - -Co-authored-by: Steve Piercy <web@stevepiercy.com> - ---------- - -Co-authored-by: Víctor Fernández de Alba <sneridagh@gmail.com> -Co-authored-by: Steve Piercy <web@stevepiercy.com> -Co-authored-by: Timo Stollenwerk <tisto@users.noreply.github.com> +Undeprecate comma-separated list of expansion (#1707) Files changed: -A news/1704.feature -A src/plone/restapi/tests/http-examples/querystring_get_contextual.req -A src/plone/restapi/tests/http-examples/querystring_get_contextual.resp -M docs/source/endpoints/querystring.md -M src/plone/restapi/services/querystring/configure.zcml -M src/plone/restapi/services/querystring/get.py -M src/plone/restapi/tests/test_documentation.py +A news/1696.bugfix +M src/plone/restapi/serializer/expansion.py -b'diff --git a/docs/source/endpoints/querystring.md b/docs/source/endpoints/querystring.md\nindex 03c6e6ef38..b376fa0625 100644\n--- a/docs/source/endpoints/querystring.md\n+++ b/docs/source/endpoints/querystring.md\n@@ -1,40 +1,36 @@\n ---\n myst:\n html_meta:\n- "description": "The @querystring endpoint returns the querystring configuration of plone.app.querystring."\n- "property=og:description": "The @querystring endpoint returns the querystring configuration of plone.app.querystring."\n+ "description": "The @querystring endpoint returns metadata about available query operations."\n+ "property=og:description": "The @querystring endpoint returns metadata about available query operations."\n "property=og:title": "Querystring"\n "keywords": "Plone, plone.restapi, REST, API, Querystring"\n ---\n \n # Querystring\n \n-The `@querystring` endpoint returns the `querystring` configuration of `plone.app.querystring`.\n+The `@querystring` endpoint returns metadata about the query operations that can be performed using the [`@querystringsearch`](querystringsearch) endpoint.\n \n-Instead of simply exposing the `querystring` related `field` and `operation` entries from the registry, it serializes them in the same way that `p.a.querystring` does in its `@@querybuilderjsonconfig` view.\n+The results include all of the indexes that can be queried, along with metadata about each index.\n+The top-level `indexes` property includes all indexes, and the top-level `sortable_indexes` property includes only the indexes that can be used to sort.\n \n-This form is structured in a more convenient way for frontends to process:\n+Each index result includes a list of the query operations that can be performed on that index.\n+The `operations` property contains the list of operations as dotted names.\n+The `operators` property contains additional metadata about each operation.\n \n-- *Vocabularies* will be resolved.\n- Their values will be inlined in the `values` property.\n-- *Operations* will be inlined as well.\n- The `operations` property will contain the list of operations as dotted names.\n- The `operators` property will contain the full definition of each of those operations supported by that field.\n-- Indexes that are flagged as *sortable* are listed in a dedicated top-level property `sortable_indexes`.\n+If an index uses a vocabulary, the vocabulary values are included in the `values` property.\n+The vocabulary is resolved in the same context where the `/@querystring` endpoint is called (requires `plone.app.querystring >= 2.1.0`).\n \n-Available options for the querystring in a Plone site can be queried by interacting with the `/@querystring` endpoint on the portal root:\n+## Get `querystring` configuration\n \n-\n-## Querystring Config\n-\n-To retrieve all `querystring` options in the portal, call the `/@querystring` endpoint with a `GET` request:\n+To get the metadata about all query operations available in the portal, call the `/@querystring` endpoint with a `GET` request:\n \n ```{eval-rst}\n .. http:example:: curl httpie python-requests\n :request: ../../../src/plone/restapi/tests/http-examples/querystring_get.req\n ```\n \n-The server will respond with all `querystring` options in the portal:\n+The server will respond with the metadata:\n \n ```{literalinclude} ../../../src/plone/restapi/tests/http-examples/querystring_get.resp\n :language: http\ndiff --git a/news/1704.feature b/news/1704.feature\nnew file mode 100644\nindex 0000000000..e6f9ca41cd\n--- /dev/null\n+++ b/news/1704.feature\n@@ -0,0 +1 @@\n+Add support for getting the `/@querystring` endpoint in a specific context. @davisagli\ndiff --git a/src/plone/restapi/services/querystring/configure.zcml b/src/plone/restapi/services/querystring/configure.zcml\nindex 0cc223e650..f7e6f38343 100644\n--- a/src/plone/restapi/services/querystring/configure.zcml\n+++ b/src/plone/restapi/services/querystring/configure.zcml\n@@ -12,6 +12,15 @@\n permission="zope2.View"\n name="@querystring"\n />\n+\n+ \n+\n