Skip to content

Commit 29dc836

Browse files
committed
WIP
1 parent dc4f248 commit 29dc836

File tree

129 files changed

+5278
-2741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+5278
-2741
lines changed

lang/en.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@
3939
"lodata::New property values": "New property values",
4040
"lodata::Updated entity": "Updated entity",
4141
"lodata::Delete entity from :set": "Delete entity from :set",
42-
"lodata::Key: :key": "Key: :key"
42+
"lodata::Key: :key": "Key: :key",
43+
"lodata::Invocation response": "Invocation response",
44+
"lodata::Singleton response": "Singleton response",
45+
"lodata::Get entity from :name": "Get entity from :name"
4346
}

lang/es.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"lodata:::name (Create schema)": ":name (Crear esquema)",
33
"lodata:::name (Update schema)": ":name (Actualizar esquema)",
44
"lodata::OData Service for namespace :namespace": "Servicio OData para namespace :namespace",
5-
"lodata::This OData service is located at [:endpoint](:endpoint)\n\n## References\n- :refCore\n- :refMeasures": "Este servicio de OData se encuentra en [:endpoint] (:endpoint)\n\n## Referencias\n- :RefCore\n- :refMeasures",
6-
"lodata::Invoke function :name": "Invoca la funci\u00f3n :name",
7-
"lodata::Invoke action :name": "Invoca la acci\u00f3n :name",
5+
"lodata::This OData service is located at [:endpoint](:endpoint)\n\n## References\n- :refCore\n- :refMeasures": "Este servicio de OData se encuentra en [:endpoint] (:endpoint)\n\n## Referencias\n- :refCore\n- :refMeasures",
6+
"lodata::Invoke function :name": "Invocar la funci\u00f3n :name",
7+
"lodata::Invoke action :name": "Invocar la acci\u00f3n :name",
88
"lodata::Service operations": "Operaciones de servicio",
99
"lodata::Success": "\u00c9xito",
1010
"lodata::Send a group of requests": "Enviar un grupo de solicitudes",
11-
"lodata::Group multiple requests into a single request payload, see :ref": "Agrupa varias solicitudes en una sola carga de solicitudes, consulta :ref",
11+
"lodata::Group multiple requests into a single request payload, see :ref": "Agrupe varias solicitudes en una sola carga de solicitudes, consulte :ref",
1212
"lodata::Batch requests": "Solicitudes por lotes",
13-
"lodata::Batch request": "Solicitud de lotes",
13+
"lodata::Batch request": "Solicitud de lote",
1414
"lodata::Batch response": "Respuesta por lotes",
1515
"lodata::Count (parameter)": "Recuento (par\u00e1metro)",
1616
"lodata::The number of entities in the collection. Available when using the :ref query option": "El n\u00famero de entidades de la colecci\u00f3n. Disponible cuando se utiliza la opci\u00f3n de consulta :ref",
@@ -20,24 +20,27 @@
2020
"lodata::Skip the first n items, see :ref": "Omita los primeros n elementos, consulte :ref",
2121
"lodata::Skip using a skip token, see :ref": "Omita el uso de un token de omisi\u00f3n, consulte :ref",
2222
"lodata::Include count of items, see :ref": "Incluye el recuento de art\u00edculos, consulta :ref",
23-
"lodata::Filter items by property values, see :ref": "Filtra elementos por valores de propiedad, consulta :ref",
23+
"lodata::Filter items by property values, see :ref": "Filtra los elementos por valores de propiedad, consulta :ref",
2424
"lodata::Search items by search phrases, see :ref": "Busca elementos por frases de b\u00fasqueda, consulta :ref",
2525
"lodata::Expand related entities, see :ref": "Ampl\u00ede las entidades relacionadas, consulte :ref",
26-
"lodata::Select properties to be returned, see :ref": "Seleccione las propiedades que desea devolver, consulte :ref",
27-
"lodata::Order items by property values, see :ref": "Ordene los art\u00edculos por valores de propiedad, consulte :ref",
28-
"lodata::Get entities from related :name": "Obtenga entidades de :name relacionados",
29-
"lodata::Get entities from :name": "Obtenga entidades de :name",
26+
"lodata::Select properties to be returned, see :ref": "Seleccione las propiedades que desee devolver, consulte :ref",
27+
"lodata::Order items by property values, see :ref": "Ordena los art\u00edculos por valores de propiedad, consulta :ref",
28+
"lodata::Get entities from related :name": "Obtener entidades de :name relacionados",
29+
"lodata::Get entities from :name": "Obtener entidades de :name",
3030
"lodata::Retrieved entities": "Entidades recuperadas",
3131
"lodata::Collection of :name": "Colecci\u00f3n de :name",
32-
"lodata::Add new entity to related :name": "A\u00f1adir una nueva entidad a :name relacionada",
32+
"lodata::Add new entity to related :name": "A\u00f1adir una nueva entidad al :name relacionado",
3333
"lodata::Add new entity to :name": "A\u00f1adir nueva entidad a :name",
3434
"lodata::New entity": "Nueva entidad",
3535
"lodata::Created entity": "Entidad creada",
3636
"lodata::Get entity from :set by key": "Obtener entidad de :set por clave",
3737
"lodata::Retrieved entity": "Entidad recuperada",
38-
"lodata::Update entity in :set": "Actualiza la entidad en :set",
38+
"lodata::Update entity in :set": "Actualizar entidad en :set",
3939
"lodata::New property values": "Nuevos valores de propiedades",
4040
"lodata::Updated entity": "Entidad actualizada",
4141
"lodata::Delete entity from :set": "Eliminar entidad de :set",
42-
"lodata::Key: :key": "Clave: :key"
42+
"lodata::Key: :key": "Clave: :key",
43+
"lodata::Invocation response": "Respuesta de invocaci\u00f3n",
44+
"lodata::Singleton response": "Respuesta \u00fanica",
45+
"lodata::Get entity from :name": "Obtener entidad de :name"
4346
}

lang/fr-CA.json

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,45 @@
22
"lodata:::name (Create schema)": ":name (Cr\u00e9er un sch\u00e9ma)",
33
"lodata:::name (Update schema)": ":name (Mettre \u00e0 jour le sch\u00e9ma)",
44
"lodata::OData Service for namespace :namespace": "Service OData pour l'espace de noms :namespace",
5-
"lodata::This OData service is located at [:endpoint](:endpoint)\n\n## References\n- :refCore\n- :refMeasures": "Ce service OData se trouve \u00e0 [:endpoint] ({endpoint}}) (:endpoint)\n\n## R\u00e9f\u00e9rences\n- :refCore\n- :refMeasure",
6-
"lodata::Invoke function :name": "Appeler la fonction :name",
5+
"lodata::This OData service is located at [:endpoint](:endpoint)\n\n## References\n- :refCore\n- :refMeasures": "Ce service OData est situ\u00e9 \u00e0 [:endpoint] (:endpoint)\n\n## R\u00e9f\u00e9rences\n- :ReFCore\n- :RefMeasure",
6+
"lodata::Invoke function :name": "Invoquer la fonction :nom",
77
"lodata::Invoke action :name": "Invoquer l'action :name",
88
"lodata::Service operations": "Op\u00e9rations de service",
99
"lodata::Success": "Succ\u00e8s",
1010
"lodata::Send a group of requests": "Envoyer un groupe de demandes",
11-
"lodata::Group multiple requests into a single request payload, see :ref": "Regroupez plusieurs demandes en une seule charge utile de demande, voir :ref",
11+
"lodata::Group multiple requests into a single request payload, see :ref": "Regrouper plusieurs demandes en une seule charge utile, voir :ref",
1212
"lodata::Batch requests": "Demandes par lots",
1313
"lodata::Batch request": "Demande de lot",
1414
"lodata::Batch response": "R\u00e9ponse par lots",
1515
"lodata::Count (parameter)": "Nombre (param\u00e8tre)",
16-
"lodata::The number of entities in the collection. Available when using the :ref query option": "Nombre d'entit\u00e9s dans la collection. Disponible lorsque vous utilisez l'option de requ\u00eate :ref",
16+
"lodata::The number of entities in the collection. Available when using the :ref query option": "Nombre d'entit\u00e9s dans la collection. Disponible lors de l'utilisation de l'option de requ\u00eate :ref",
1717
"lodata::Error": "Erreur",
18-
"lodata::The structure of this object is service-specific": "La structure de cet objet est sp\u00e9cifique au service",
18+
"lodata::The structure of this object is service-specific": "La structure de cet objet est propre au service",
1919
"lodata::Show only the first n items, see :ref": "Afficher uniquement les n premiers objets, voir :ref",
20-
"lodata::Skip the first n items, see :ref": "Ignorer les n premiers \u00e9l\u00e9ments, voir :ref",
20+
"lodata::Skip the first n items, see :ref": "Ignorer les n premiers objets, voir :ref",
2121
"lodata::Skip using a skip token, see :ref": "Ignorer l'utilisation d'un jeton de saut, voir :ref",
2222
"lodata::Include count of items, see :ref": "Inclure le nombre d'objets, voir :ref",
23-
"lodata::Filter items by property values, see :ref": "Filtrer les \u00e9l\u00e9ments par valeur de propri\u00e9t\u00e9, voir :ref",
23+
"lodata::Filter items by property values, see :ref": "Filtrer les \u00e9l\u00e9ments en fonction de la valeur des propri\u00e9t\u00e9s, voir :ref",
2424
"lodata::Search items by search phrases, see :ref": "Rechercher des objets par phrases de recherche, voir :ref",
2525
"lodata::Expand related entities, see :ref": "D\u00e9velopper les entit\u00e9s li\u00e9es, voir :ref",
2626
"lodata::Select properties to be returned, see :ref": "S\u00e9lectionnez les propri\u00e9t\u00e9s \u00e0 retourner, voir :ref",
27-
"lodata::Order items by property values, see :ref": "Commandez des objets par valeur de propri\u00e9t\u00e9, voir :ref",
28-
"lodata::Get entities from related :name": "Obtenir des entit\u00e9s de :name apparent\u00e9es",
29-
"lodata::Get entities from :name": "Obtenir les entit\u00e9s de :name",
27+
"lodata::Order items by property values, see :ref": "Commandez des objets en fonction de la valeur des propri\u00e9t\u00e9s, voir :ref",
28+
"lodata::Get entities from related :name": "Obtenir des entit\u00e9s de :name",
29+
"lodata::Get entities from :name": "Obtenir des entit\u00e9s de :name",
3030
"lodata::Retrieved entities": "Entit\u00e9s extraites",
31-
"lodata::Collection of :name": "Collecte de :name",
32-
"lodata::Add new entity to related :name": "Ajouter une nouvelle entit\u00e9 \u00e0 :name associ\u00e9",
31+
"lodata::Collection of :name": "Collecte de :nom",
32+
"lodata::Add new entity to related :name": "Ajouter une nouvelle entit\u00e9 \u00e0 :nom",
3333
"lodata::Add new entity to :name": "Ajouter une nouvelle entit\u00e9 \u00e0 :name",
3434
"lodata::New entity": "Nouvelle entit\u00e9",
3535
"lodata::Created entity": "Entit\u00e9 cr\u00e9\u00e9e",
3636
"lodata::Get entity from :set by key": "Obtenir l'entit\u00e9 de :set par cl\u00e9",
3737
"lodata::Retrieved entity": "Entit\u00e9 extraite",
3838
"lodata::Update entity in :set": "Mettre \u00e0 jour l'entit\u00e9 dans :set",
39-
"lodata::New property values": "Nouvelles valeurs fonci\u00e8res",
39+
"lodata::New property values": "Valeur des nouvelles propri\u00e9t\u00e9s",
4040
"lodata::Updated entity": "Entit\u00e9 \u00e0 jour",
41-
"lodata::Delete entity from :set": "Supprimer l'entit\u00e9 de :set",
42-
"lodata::Key: :key": "Cl\u00e9\u00a0: :key"
41+
"lodata::Delete entity from :set": "Supprimer une entit\u00e9 de :set",
42+
"lodata::Key: :key": "Cl\u00e9\u00a0: :key",
43+
"lodata::Invocation response": "R\u00e9ponse \u00e0 l'invocation",
44+
"lodata::Singleton response": "R\u00e9ponse de Singleton",
45+
"lodata::Get entity from :name": "Obtenir l'entit\u00e9 de :name"
4346
}

src/ComplexType.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function getOpenAPISchema(): array
218218
return [
219219
'type' => Constants::oapiObject,
220220
'title' => $this->getName(),
221-
'properties' => $this->getDeclaredProperties()->map(function (DeclaredProperty $property) {
221+
'properties' => (object)$this->getDeclaredProperties()->map(function (DeclaredProperty $property) {
222222
return $property->getOpenAPISchema();
223223
})
224224
];
@@ -233,7 +233,7 @@ public function getOpenAPICreateSchema(): array
233233
return [
234234
'type' => Constants::oapiObject,
235235
'title' => __('lodata:::name (Create schema)', ['name' => $this->getName()]),
236-
'properties' => $this->getDeclaredProperties()->filter(function (DeclaredProperty $property) {
236+
'properties' => (object)$this->getDeclaredProperties()->filter(function (DeclaredProperty $property) {
237237
return $property->getAnnotations()->sliceByClass([Computed::class])->isEmpty();
238238
})->map(function (DeclaredProperty $property) {
239239
return $property->getOpenAPISchema();
@@ -250,7 +250,7 @@ public function getOpenAPIUpdateSchema(): array
250250
return [
251251
'type' => Constants::oapiObject,
252252
'title' => __('lodata:::name (Update schema)', ['name' => $this->getName()]),
253-
'properties' => $this->getDeclaredProperties()->filter(function (DeclaredProperty $property) {
253+
'properties' => (object)$this->getDeclaredProperties()->filter(function (DeclaredProperty $property) {
254254
return $property->getAnnotations()->sliceByClass([Computed::class])->isEmpty();
255255
})->map(function (DeclaredProperty $property) {
256256
return $property->getOpenAPISchema();

src/ComplexValue.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,4 +404,12 @@ protected function getMetadata(Transaction $transaction): MetadataContainer
404404

405405
return $metadata;
406406
}
407+
408+
/**
409+
* @return array
410+
*/
411+
public function getOpenAPISchema(): array
412+
{
413+
return $this->getType()->getOpenAPISchema();
414+
}
407415
}

src/EntityType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function getOpenAPIUpdateSchema(): array
9797
return [
9898
'type' => Constants::oapiObject,
9999
'title' => __('lodata:::name (Update schema)', ['name' => $this->getName()]),
100-
'properties' => $this->getDeclaredProperties()->filter(function (DeclaredProperty $property) {
100+
'properties' => (object)$this->getDeclaredProperties()->filter(function (DeclaredProperty $property) {
101101
return $property->getAnnotations()->sliceByClass([Computed::class])->isEmpty() && $property !== $this->getKey();
102102
})->map(function (DeclaredProperty $property) {
103103
return $property->getOpenAPISchema();

src/EnumerationType.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,6 @@ public function instance($value = 0): Primitive
138138
return new Enum($this, $value);
139139
}
140140

141-
/**
142-
* Get the OpenAPI schema for this primitive type
143-
* @return array
144-
*/
145-
public function getOpenAPISchema(): array
146-
{
147-
return [
148-
'type' => Constants::oapiString,
149-
'enum' => $this->getMembers()->keys(),
150-
];
151-
}
152-
153141
/**
154142
* Get the OData enumeration type name for this class
155143
* @param string $enum Enum class name

src/Helper/CollectionType.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ public function instance($value = []): Primitive
3131
return (new Collection)->setCollectionType($this)->set($value);
3232
}
3333

34-
public function getOpenAPISchema(): array
35-
{
36-
return [
37-
'type' => Constants::oapiArray,
38-
'items' => $this->getUnderlyingType()->getOpenAPISchema(),
39-
];
40-
}
41-
4234
public function getIdentifier(): Identifier
4335
{
4436
return $this->getUnderlyingType()->getIdentifier();

src/Helper/Identifier.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ public function __construct(string $identifier)
4040
$this->namespace = Str::beforeLast($identifier, '.');
4141
}
4242

43+
/**
44+
* Factory method to create an identifier
45+
* @param string $identifier Identifier
46+
* @return Identifier
47+
*/
48+
public static function from(string $identifier): Identifier
49+
{
50+
return new self($identifier);
51+
}
52+
4353
/**
4454
* Get the identifier name
4555
* @return string

src/Helper/ObjectArray.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Flat3\Lodata\Interfaces\IdentifierInterface;
1010
use Illuminate\Support\Arr;
1111
use Iterator;
12+
use ReturnTypeWillChange;
1213
use TypeError;
1314

1415
/**
@@ -115,7 +116,7 @@ public function exists($key): bool
115116
* Get the current value in the array
116117
* @return mixed
117118
*/
118-
#[\ReturnTypeWillChange]
119+
#[ReturnTypeWillChange]
119120
public function current()
120121
{
121122
return current($this->array);
@@ -200,7 +201,7 @@ public function get($key)
200201
* @param mixed $offset
201202
* @return mixed|null
202203
*/
203-
#[\ReturnTypeWillChange]
204+
#[ReturnTypeWillChange]
204205
public function offsetGet($offset)
205206
{
206207
return $this->get($offset);

src/Operation/Argument.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Flat3\Lodata\Operation;
66

7+
use Flat3\Lodata\DynamicProperty;
78
use Flat3\Lodata\Interfaces\NameInterface;
89
use Flat3\Lodata\Interfaces\TypeInterface;
910
use Flat3\Lodata\Operation;
@@ -99,8 +100,8 @@ public function getParameter(): ReflectionParameter
99100
*/
100101
public function getOpenAPISchema(): array
101102
{
102-
return array_merge($this->getType()->getOpenAPISchema(), [
103-
'nullable' => $this->isNullable(),
104-
]);
103+
return (new DynamicProperty('arg', $this->getType()))
104+
->setNullable($this->isNullable())
105+
->getOpenAPISchema();
105106
}
106107
}

0 commit comments

Comments
 (0)