Skip to content
Open
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
28 changes: 20 additions & 8 deletions core/openapi/ogcapi-features-1-oas30.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,27 @@ components:
type: string
exception:
type: object
description: |-
Information about the exception: an error code plus an optional description.
required:
- code
title: An RFC 9457 problem object
properties:
code:
type:
type: string
description:
format: uri-reference
description: A URI reference that identifies the problem type.
title:
type: string
description: A short, human-readable summary of the problem type.
status:
type: integer
minimum: 100
maximum: 599
description: The HTTP status code generated by the origin server for this occurrence of the problem.
detail:
type: string
description: A human-readable explanation specific to this occurrence of the problem.
instance:
type: string
format: uri-reference
description: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
extent:
type: object
description: |-
Expand Down Expand Up @@ -883,7 +895,7 @@ components:
description: |-
A query parameter has an invalid value.
content:
application/json:
application/problem+json:
schema:
$ref: '#/components/schemas/exception'
text/html:
Expand All @@ -899,7 +911,7 @@ components:
description: |-
A server error occurred.
content:
application/json:
application/problem+json:
schema:
$ref: '#/components/schemas/exception'
text/html:
Expand Down
28 changes: 20 additions & 8 deletions core/openapi/ogcapi-features-1-oas31.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,27 @@ components:
type: string
exception:
type: object
description: |-
Information about the exception: an error code plus an optional description.
required:
- code
title: An RFC 9457 problem object
properties:
code:
type:
type: string
description:
format: uri-reference
description: A URI reference that identifies the problem type.
title:
type: string
description: A short, human-readable summary of the problem type.
status:
type: integer
minimum: 100
maximum: 599
description: The HTTP status code generated by the origin server for this occurrence of the problem.
detail:
type: string
description: A human-readable explanation specific to this occurrence of the problem.
instance:
type: string
format: uri-reference
description: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
extent:
type: object
description: |-
Expand Down Expand Up @@ -877,7 +889,7 @@ components:
description: |-
A query parameter has an invalid value.
content:
application/json:
application/problem+json:
schema:
$ref: '#/components/schemas/exception'
text/html:
Expand All @@ -893,7 +905,7 @@ components:
description: |-
A server error occurred.
content:
application/json:
application/problem+json:
schema:
$ref: '#/components/schemas/exception'
text/html:
Expand Down
28 changes: 20 additions & 8 deletions core/openapi/ogcapi-features-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,27 @@ components:
type: string
exception:
type: object
description: |-
Information about the exception: an error code plus an optional description.
required:
- code
title: An RFC 9457 problem object
properties:
code:
type:
type: string
description:
format: uri-reference
description: A URI reference that identifies the problem type.
title:
type: string
description: A short, human-readable summary of the problem type.
status:
type: integer
minimum: 100
maximum: 599
description: The HTTP status code generated by the origin server for this occurrence of the problem.
detail:
type: string
description: A human-readable explanation specific to this occurrence of the problem.
instance:
type: string
format: uri-reference
description: A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
extent:
type: object
description: |-
Expand Down Expand Up @@ -859,7 +871,7 @@ components:
description: |-
A query parameter has an invalid value.
content:
application/json:
application/problem+json:
schema:
$ref: '#/components/schemas/exception'
text/html:
Expand All @@ -875,7 +887,7 @@ components:
description: |-
A server error occurred.
content:
application/json:
application/problem+json:
schema:
$ref: '#/components/schemas/exception'
text/html:
Expand Down
17 changes: 16 additions & 1 deletion core/standard/clause_7_core.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,25 @@ include::recomendations/core/PER_additional-status-codes.adoc[]
The API Description Document describes the HTTP status codes generated by that API. This is not an exhaustive list of all possible status codes. It is not reasonable to expect an API designer to control the use of HTTP status codes which are not generated by their software. Therefore, it is recommended that the API Description Document limit itself to describing HTTP status codes relevant to the proper operation of the API application logic. Client implementations have to be prepared to receive HTTP status codes in addition to those described in the API Description Document.

[[errors]]
=== Errors in requests
=== Error responses

include::recomendations/core/REC_rfc9457.adoc[]

Such a problem detail is returned in the response body using the media type `application/problem+json`. Its schema is available at link:http://schemas.opengis.net/ogcapi/features/part1/1.1/openapi/schemas/exception.yaml[exception.yaml].

[[example_3a]]
.A problem detail for an invalid request parameter (media type `application/problem+json`)
=================
[source,JSON]
----
{
"title": "Bad Request",
"status": 400,
"detail": "The query parameter 'datetime' has an invalid value."
}
----
=================

[[query_parameters]]
=== Unknown or invalid query parameters

Expand Down
2 changes: 1 addition & 1 deletion core/standard/clause_9_oas.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ include::requirements/oas/REQ_exception-codes.adoc[]
----
description: An error occurred.
content:
application/json:
application/problem+json:
schema:
$ref: http://schemas.opengis.net/ogcapi/features/part1/1.1/openapi/schemas/exception.yaml
text/html:
Expand Down
2 changes: 1 addition & 1 deletion core/standard/recomendations/core/REC_rfc9457.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/core/rfc9457*
^|A |Errors in requests SHOULD be reported in accordance with <<rfc9457,RFC 9457 (Problem Details for HTTP APIs)>>.
^|A |Error responses SHOULD include a problem detail as defined in <<rfc9457,RFC 9457 (Problem Details for HTTP APIs)>>.
|===