mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 18:28:49 +02:00
Added tests for all API endpoints of Structural elements
This commit is contained in:
parent
7b5ae70de3
commit
3d67ad870a
16 changed files with 887 additions and 3 deletions
|
@ -180,6 +180,7 @@ abstract class Attachment extends AbstractNamedDBElement
|
|||
#[ORM\JoinColumn(name: 'type_id', nullable: false)]
|
||||
#[Selectable]
|
||||
#[Groups(['attachment:read', 'attachment:write'])]
|
||||
#[ApiProperty(readableLink: false)]
|
||||
protected ?AttachmentType $attachment_type = null;
|
||||
|
||||
#[Groups(['attachment:read'])]
|
||||
|
|
|
@ -92,7 +92,7 @@ class AttachmentType extends AbstractStructuralDBElement
|
|||
#[ORM\ManyToOne(targetEntity: AttachmentType::class, inversedBy: 'children')]
|
||||
#[ORM\JoinColumn(name: 'parent_id')]
|
||||
#[Groups(['attachment_type:read', 'attachment_type:write'])]
|
||||
#[ApiProperty(readableLink: false, writableLink: false)]
|
||||
#[ApiProperty(readableLink: true, writableLink: false)]
|
||||
protected ?AbstractStructuralDBElement $parent = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -74,7 +74,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
denormalizationContext: ['groups' => ['measurement_unit:write', 'api:basic:write', 'attachment:write', 'parameter:write'], 'openapi_definition_name' => 'Write'],
|
||||
)]
|
||||
#[ApiResource(
|
||||
uriTemplate: '/footprints/{id}/children.{_format}',
|
||||
uriTemplate: '/measurement_units/{id}/children.{_format}',
|
||||
operations: [
|
||||
new GetCollection(
|
||||
openapi: new Operation(summary: 'Retrieves the children elements of a MeasurementUnit.'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue