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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ See [keep a changelog] for information about writing changes to this log.

## [Unreleased]

- [PR-76](https://github.com/itk-dev/event-database-api/pull/76)
Update API Platform to 4.4 (OpenAPI 3.2.0, no `charset` in the `application/ld+json` content type)
- [PR-75](https://github.com/itk-dev/event-database-api/pull/75)
Update Rector (2.8) and PHPStan (2.3) and apply the new Rector rules
- [PR-74](https://github.com/itk-dev/event-database-api/pull/74)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": ">=8.5",
"ext-ctype": "*",
"ext-iconv": "*",
"api-platform/core": "~4.3.0",
"api-platform/core": "~4.4.0",
"elasticsearch/elasticsearch": "^8.19",
"nelmio/cors-bundle": "^2.4",
"phpdocumentor/reflection-docblock": "^5.6",
Expand Down
94 changes: 47 additions & 47 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions config/reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -1070,10 +1070,10 @@
* inflector?: scalar|Param|null, // Specify an inflector to use. // Default: "api_platform.metadata.inflector"
* validator?: array{
* serialize_payload_fields?: mixed, // Set to null to serialize all payload fields when a validation error is thrown, or set the fields you want to include explicitly. // Default: []
* query_parameter_validation?: bool|Param, // Deprecated: Will be removed in API Platform 5.0. // Default: true
* query_parameter_validation?: bool|Param, // Deprecated: The "query_parameter_validation" configuration is deprecated and will be removed in API Platform 5.0. // Default: true
* },
* jsonapi?: array{
* use_iri_as_id?: bool|Param, // Set to false to use entity identifiers instead of IRIs as the "id" field in JSON:API responses. // Default: true
* use_iri_as_id?: bool|Param|null, // Set to false to use entity identifiers instead of IRIs as the "id" field in JSON:API responses. Defaults to true; this default will change to false in API Platform 5.0. // Default: null
* allow_client_generated_id?: bool|Param, // Allow client-generated IDs on JSON:API POST per https://jsonapi.org/format/#crud-creating-client-ids. Off by default to prevent id spoofing on public endpoints. // Default: false
* },
* eager_loading?: bool|array{
Expand All @@ -1090,9 +1090,10 @@
* enable_scalar?: bool|Param, // Enable Scalar API Reference // Default: true
* enable_entrypoint?: bool|Param, // Enable the entrypoint // Default: true
* enable_docs?: bool|Param, // Enable the docs // Default: true
* enable_head_request_optimization?: bool|Param, // Skip response body construction on HEAD requests so collections are not iterated. Disable to process HEAD identically to GET. // Default: true
* enable_profiler?: bool|Param, // Enable the data collector and the WebProfilerBundle integration. // Default: true
* enable_phpdoc_parser?: bool|Param, // Enable resource metadata collector using PHPStan PhpDocParser. // Default: true
* enable_link_security?: bool|Param, // Deprecated: This option is always enabled and will be removed in API Platform 5.0. // Enable security for Links (sub resources). // Default: true
* enable_link_security?: bool|Param, // Deprecated: The "enable_link_security" configuration is deprecated, this option is always enabled and will be removed in API Platform 5.0. // Enable security for Links (sub resources). // Default: true
* collection?: array{
* exists_parameter_name?: scalar|Param|null, // The name of the query parameter to filter on nullable field values. // Default: "exists"
* order?: scalar|Param|null, // The default order of results. // Default: "ASC"
Expand Down Expand Up @@ -1155,6 +1156,7 @@
* },
* swagger?: array{
* persist_authorization?: bool|Param, // Persist the SwaggerUI Authorization in the localStorage. // Default: false
* with_credentials?: bool|Param, // Send credentials (cookies, authorization headers) on Swagger UI cross-origin requests (e.g. when running behind Cloudflare Access). // Default: false
* versions?: list<scalar|Param|null>,
* api_keys?: array<string, array{ // Default: []
* name?: scalar|Param|null, // The name of the header or query parameter containing the api key.
Expand Down Expand Up @@ -1271,6 +1273,7 @@
* denormalization_context?: mixed,
* collect_denormalization_errors?: mixed,
* hydra_context?: mixed,
* jsonld_context?: mixed,
* openapi?: mixed,
* validation_context?: mixed,
* filters?: mixed,
Expand Down Expand Up @@ -1338,6 +1341,7 @@
* strict_query_parameter_validation?: mixed,
* hide_hydra_operation?: mixed,
* json_stream?: mixed,
* throw_on_not_found?: mixed,
* extra_properties?: mixed,
* map?: mixed,
* mcp?: mixed,
Expand Down
6 changes: 2 additions & 4 deletions public/spec.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
openapi: 3.1.0
openapi: 3.2.0
info:
title: 'Event Database'
description: 'API for the Event Database'
Expand Down Expand Up @@ -1800,9 +1800,7 @@ components:
tags:
type: array
items:
type:
- string
- 'null'
type: string
responses: { }
parameters: { }
examples: { }
Expand Down
3 changes: 3 additions & 0 deletions src/Api/Dto/Vocabulary.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
)]
readonly class Vocabulary
{
/**
* @param list<string> $tags
*/
public function __construct(
public string $name,
#[ApiProperty(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function testLdJsonIsSupported(): void
$response = $this->requestWithAccept('application/ld+json');

$this->assertSame(Response::HTTP_OK, $response->getStatusCode());
$this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8');
$this->assertResponseHeaderSame('content-type', 'application/ld+json');
}

public function testPlainJsonIsNotAcceptable(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/ApiPlatform/Trait/GetEntitiesTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function testGetEntities(): void
$response = $this->get([]);

$this->assertResponseStatusCodeSame(Response::HTTP_OK);
$this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8');
$this->assertResponseHeaderSame('content-type', 'application/ld+json');
$this->assertJson($response->getContent());

$data = $response->toArray();
Expand Down
2 changes: 1 addition & 1 deletion tests/ApiPlatform/Trait/GetItemTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function testGetItem(): void

$response = $this->get([], $path);
$this->assertResponseStatusCodeSame(Response::HTTP_OK);
$this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8');
$this->assertResponseHeaderSame('content-type', 'application/ld+json');
$this->assertJson($response->getContent());
$this->assertMatchesResourceItemJsonSchema(static::$resourceClass);
}
Expand Down
Loading