Skip to content

Commit b15d021

Browse files
authored
Merge pull request #140 from ppkarwasz/feat/find-by-identifier
feat: find products by identifier
2 parents be9c76b + 65e7dcf commit b15d021

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

spec/openapi.yaml

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# $schema: https://spec.openapis.org/oas/3.1/schema-base/2025-02-13
12
openapi: 3.1.1
23
jsonSchemaDialect: https://spec.openapis.org/oas/3.1/dialect/base
34
info:
@@ -49,7 +50,8 @@ paths:
4950
parameters:
5051
- $ref: "#/components/parameters/page-offset"
5152
- $ref: "#/components/parameters/page-size"
52-
- $ref: "#/components/parameters/tei_urn"
53+
- $ref: "#/components/parameters/id-type"
54+
- $ref: "#/components/parameters/id-value"
5355
responses:
5456
'200':
5557
$ref: "#/components/responses/paginated-product"
@@ -680,14 +682,45 @@ components:
680682
type: integer
681683
format: int64
682684
default: 100
683-
# Identifiers
684-
tei_urn:
685-
name: teiUrn
686-
description: Transparency Exchange Identifier (URN)
685+
#
686+
# Query by identifier
687+
#
688+
# Since OpenAPI 3.0 it is possible to use RFC 6570-based serialization for JSON parameters of type array or object:
689+
# https://swagger.io/docs/specification/v3_0/serialization/
690+
#
691+
# Unfortunately many tools don't support it, for example,
692+
# the `openapi-generator` for Java does not handle this correctly.
693+
# https://github.com/OpenAPITools/openapi-generator/issues/4808
694+
#
695+
# This can be uncommented, when RFC 6570-base serialization reaches a wider adoption:
696+
#
697+
# identifier-param:
698+
# name: identifierParam
699+
# description: If present, only the objects with the given identifier will be returned.
700+
# in: query
701+
# schema:
702+
# $ref: "#/components/schemas/identifier"
703+
# style: form
704+
# explode: true
705+
#
706+
# In the meantime we explode the object manually:
707+
id-type:
708+
# To allow RFC 6570 in the future without breaking changes to the HTTP API,
709+
# the name of this parameter should be identical to the equivalent property in /components/schemas/identifier
710+
name: idType
711+
description: Type of identifier specified in the `idValue` parameter
712+
in: query
713+
schema:
714+
$ref: "#/components/schemas/identifier-type"
715+
id-value:
716+
# To allow RFC 6570 in the future without breaking changes to the HTTP API,
717+
# the name of this parameter should be identical to the equivalent property in /components/schemas/identifier
718+
name: idValue
719+
description: If present, only the objects with the given identifier value will be returned.
687720
in: query
688721
schema:
689722
type: string
690-
pattern: '^urn:tei:[a-z]+:[a-zA-Z0-9.-]+:[a-zA-Z0-9-]+$'
723+
691724
securitySchemes:
692725
bearerAuth:
693726
type: http

0 commit comments

Comments
 (0)