Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"ViewInput": {
"identifier": "TitleView",
"Query": {
"Filter": {
"ContentTypeIdentifierCriterion": "image",
"SectionIdentifierCriterion": "media",
"DateMetadataCriterion": {
"Target": "modified",
"Value": 1675681020,
"Operator": "gte"
}
},
"limit": 10,
"offset": 0,
"SortClauses": {
"ContentName": "ascending"
},
"Aggregations": [
{
"ContentTypeTermAggregation": {
"name": "some name"
}
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewInput>
<identifier>TitleView</identifier>
<ContentQuery>
<Query>
<Filter>
<ContentTypeIdentifierCriterion>image</ContentTypeIdentifierCriterion>
<SectionIdentifierCriterion>media</SectionIdentifierCriterion>
<DateMetadataCriterion>
<Target>modified</Target>
<Value>1675681020</Value>
<Operator>gte</Operator>
</DateMetadataCriterion>
</Filter>
<limit>10</limit>
<offset>0</offset>
<SortClauses>
<ContentName>ascending</ContentName>
</SortClauses>
<FacetBuilders>
<contentTypeFacetBuilder/>
</FacetBuilders>
</ContentQuery>
<Aggregations>
<Aggregation>
<ContentTypeTermAggregation>
<name>some name</name>
</ContentTypeTermAggregation>
</Aggregation>
</Aggregations>
</Query>
</ViewInput>
10 changes: 9 additions & 1 deletion docs/api/rest_api_reference/input/ez-views.raml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
displayName: Views
post:
displayName: Create View
description: Executes a query and returns a View including the results. The View input reflects the criteria model of the public API.
description: |
Executes a query and returns a View including the results.

View input reflects the criteria model of the public API.

Refer to [Search Criteria Reference](/en/latest/search/criteria_reference/search_criteria_reference/)
headers:
Accept:
description: The view in XML or JSON format.
Expand All @@ -21,6 +26,9 @@ post:
application/vnd.ez.api.ViewInput+xml:
type: ViewInput
example: !include examples/views/POST/ViewInput.xml.example
application/vnd.ibexa.api.ViewInput+json:
type: ViewInput
example: !include examples/views/POST/ViewInput.json.example
responses:
200:
body:
Expand Down
2,842 changes: 1,565 additions & 1,277 deletions docs/api/rest_api_reference/rest_api_reference.html

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion tools/raml2html/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"raml-org/raml-php-parser": "dev-master",
"twig/twig": "^2.0",
"symfony/filesystem": "^4.2",
"ramsey/uuid": "^3.9"
"ramsey/uuid": "^3.9",
"twig/markdown-extra": "^3.5",
"league/commonmark": "^2.3"
Copy link
Contributor

@adriendupuis adriendupuis Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires league/commonmark ^2.3 -> satisfiable by league/commonmark[2.3.0, ..., 2.3.8].
    - league/commonmark[2.3.0, ..., 2.3.8] require php ^7.4 || ^8.0 -> your php version (7.2.34) does not satisfy that requirement.

So, this addition is not fully compatible with "php": "^7.2", above.

Copy link
Contributor

@adriendupuis adriendupuis Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick fix in c34be1469801e0ce0035448577074fbbe991a4fa / #1642 for PHP 7.4 w/ few warnings at runtime.

A better fix for PHP 8.1+ will come in #1871

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adriendupuis we will need to take the raml parser and everything else related to it under our organization, because that library is in practice abandoned.

},
"require-dev": {
"symfony/var-dumper": "^4.2",
Expand Down
14 changes: 14 additions & 0 deletions tools/raml2html/src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
use EzSystems\Raml2Html\Twig\Extension\RenderExtension;
use Symfony\Component\Console\Application as BaseApplication;
use Twig as Twig;
use Twig\Extra\Markdown\DefaultMarkdown;
use Twig\Extra\Markdown\MarkdownExtension;
use Twig\Extra\Markdown\MarkdownRuntime;
use Twig\RuntimeLoader\RuntimeLoaderInterface;

final class Application extends BaseApplication
{
Expand Down Expand Up @@ -49,6 +53,16 @@ public function getTwig(): Twig\Environment

$this->twig = new Twig\Environment($loader, $options);
$this->twig->addExtension(new RenderExtension());
$this->twig->addExtension(new MarkdownExtension());
$this->twig->addRuntimeLoader(new class implements RuntimeLoaderInterface {
public function load($class): ?MarkdownRuntime {
if (MarkdownRuntime::class === $class) {
return new MarkdownRuntime(new DefaultMarkdown());
}

return null;
}
});
}

return $this->twig;
Expand Down
2 changes: 1 addition & 1 deletion tools/raml2html/themes/default/resource.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<span data-field="method" class="badge badge--sm badge--{{ method.type|lower }}">{{ method.type }}</span>
<span data-field="url">{{ resource.uri }}</span>
</p>
<p data-field="body">{{ method.description }}</p>
<p data-field="body">{{ method.description|default('')|markdown_to_html }}</p>
{% include theme ~ "/method-headers.html.twig" %}

{% include theme ~ "/method-query-parameters.html.twig" %}
Expand Down