Skip to content

Commit

Permalink
ODATA-1624 (#225)
Browse files Browse the repository at this point in the history
Fixes #391
  • Loading branch information
ralfhandl authored May 8, 2024
1 parent 82bb2ba commit 7f4c4e3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 34 deletions.
17 changes: 11 additions & 6 deletions docs/odata-protocol/odata-protocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,11 @@ <h2 id="11-changes-from-earlier-versions"><a name="ChangesfromEarlierVersions" h
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/534">534</a></td>
</tr>
<tr class="even">
<td><a href="#Conformance">Section 12</a></td>
<td>Allow <code>400 Bad Request</code> in addition to <code>501 Not Implemented</code> for unsupported functionality</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/391">391</a></td>
</tr>
<tr class="odd">
<td><a href="#InteroperableODataClients">Section 12.3</a></td>
<td>Encoding of plus character in URLs</td>
<td><a href="https://github.com/oasis-tcs/odata-specs/issues/485">485</a></td>
Expand Down Expand Up @@ -947,7 +952,7 @@ <h3 id="926-response-code-424-failed-dependency"><a name="ResponseCode424FailedD
<h2 id="93-server-error-responses"><a name="ServerErrorResponses" href="#ServerErrorResponses">9.3 Server Error Responses</a></h2>
<p>As defined in <a href="#rfc9110">RFC9110</a>, error codes in the <code>5xx</code> range indicate service errors.</p>
<h3 id="931-response-code-501-not-implemented"><a name="ResponseCode501NotImplemented" href="#ResponseCode501NotImplemented">9.3.1 Response Code <code>501 Not Implemented</code></a></h3>
<p>If the client requests functionality not implemented by the OData Service, the service responds with <code>501 Not Implemented</code> and SHOULD include a response body describing the functionality not implemented.</p>
<p>If the client requests functionality not implemented by the OData Service, the service MAY respond with <code>501 Not Implemented</code> and include a response body describing the functionality not implemented.</p>
<h2 id="94-error-response-body"><a name="ErrorResponseBody" href="#ErrorResponseBody">9.4 Error Response Body</a></h2>
<p>An error response body can be the result of a failure of OData processing or of the underlying infrastructure. An OData-specific error response (which can be recognized by the presence of the <a href="#HeaderODataVersion"><code>OData-Version</code></a> header) is format-specific and consists at least of the following information:</p>
<ul>
Expand Down Expand Up @@ -2682,7 +2687,7 @@ <h3 id="1211-odata-40-minimal-conformance-level"><a name="OData40MinimalConforma
<li><code>OData-MaxVersion</code> (<a href="#HeaderODataMaxVersion">section 8.2.7</a>)</li>
</ol></li>
<li>MUST follow OData guidelines for extensibility (<a href="#Extensibility">section 6</a> and all subsections)</li>
<li>MUST successfully parse the request according to <a href="#ODataABNF">OData-ABNF</a> for any supported system query options and either follow the specification or return <code>501 Not Implemented</code> for any unsupported functionality (<a href="#ResponseCode501NotImplemented">section 9.3.1</a>)</li>
<li>MUST successfully parse the request according to <a href="#ODataABNF">OData-ABNF</a> for any supported system query options and follow the specification or fail the request</li>
<li>MUST expose only data types defined in <a href="#ODataCSDL">OData-CSDLXML</a></li>
<li>MUST NOT require clients to understand any metadata or instance annotations (<a href="#VocabularyExtensibility">section 6.4</a>), custom headers (<a href="#HeaderFieldExtensibility">section 6.5</a>), or custom content (<a href="#PayloadExtensibility">section 6.2</a>) in the payload in order to correctly consume the service</li>
<li>MUST NOT violate any OData update semantics (<a href="#DataModification">section 11.4</a> and all subsections)</li>
Expand Down Expand Up @@ -2720,7 +2725,7 @@ <h3 id="1212-odata-40-intermediate-conformance-level"><a name="OData40Intermedia
<p>In order to conform to the OData Intermediate Conformance Level, a service:</p>
<ol type="1">
<li>MUST conform to the <a href="#OData40MinimalConformanceLevel">OData 4.0 Minimal Conformance Level</a></li>
<li>MUST successfully parse the <a href="#ODataABNF">OData-ABNF</a> and either follow the specification or return <code>501 Not Implemented</code> for any unsupported functionality (<a href="#ResponseCode501NotImplemented">section 9.3.1</a>)</li>
<li>MUST successfully parse the request according to <a href="#ODataABNF">OData-ABNF</a> and follow the specification or fail the request</li>
<li>MUST support <code>$select</code> (<a href="#SystemQueryOptionselect">section 11.2.5.1</a>)</li>
<li>MUST support casting to a derived type according to <a href="#ODataURL">OData-URL</a> if derived types are present in the model</li>
<li>MUST support <code>$top</code> (<a href="#SystemQueryOptiontop">section 11.2.6.3</a>)</li>
Expand All @@ -2729,8 +2734,8 @@ <h3 id="1212-odata-40-intermediate-conformance-level"><a name="OData40Intermedia
<ol type="1">
<li>MUST support <code>eq</code>, <code>ne</code> filter operations on properties of entities in the requested entity set (<a href="#BuiltinFilterOperations">section 11.2.6.1.1</a>)</li>
<li>MUST support aliases in <code>$filter</code> expressions (<a href="#ParameterAliases">section 11.2.6.1.3</a>)</li>
<li>SHOULD support additional filter operations (<a href="#BuiltinFilterOperations">section 11.2.6.1.1</a>) and MUST return <code>501 Not Implemented</code> for any unsupported filter operations (<a href="#ResponseCode501NotImplemented">section 9.3.1</a>)</li>
<li>SHOULD support the canonical functions (<a href="#BuiltinQueryFunctions">section 11.2.6.1.2</a>) and MUST return <code>501 Not Implemented</code> for any unsupported canonical functions (<a href="#ResponseCode501NotImplemented">section 9.3.1</a>)</li>
<li>SHOULD support additional filter operations (<a href="#BuiltinFilterOperations">section 11.2.6.1.1</a>) and MUST fail the request for any unsupported filter operations</li>
<li>SHOULD support the canonical functions (<a href="#BuiltinQueryFunctions">section 11.2.6.1.2</a>) and MUST fail the request for any unsupported canonical functions</li>
<li>SHOULD support <code>$filter</code> on expanded entities (<a href="#ExpandOptions">section 11.2.5.2.1</a>)</li>
</ol></li>
<li>SHOULD publish metadata at <code>$metadata</code> according to <a href="#ODataCSDL">OData-CSDLXML</a> (<a href="#MetadataDocumentRequest">section 11.1.2</a>)</li>
Expand Down Expand Up @@ -2893,7 +2898,7 @@ <h2 id="123-interoperable-odata-clients"><a name="InteroperableODataClients" hre
<li>MUST specify identifiers in payloads and URLs in the case they are specified in <code>$metadata</code></li>
<li>MUST be prepared to receive any valid 4.01 CSDL</li>
<li>MUST be prepared to receive any valid 4.01 response according to the requested format</li>
<li>SHOULD use capabilities (see <a href="#ODataVocCap">OData-VocCap</a>) to determine if a 4.01 feature is supported but MAY attempt syntax and be prepared to handle either <a href="#ResponseCode501NotImplemented"><code>501 Not Implemented</code></a> or <code>400 Bad Request</code></li>
<li>SHOULD use capabilities (see <a href="#ODataVocCap">OData-VocCap</a>) to determine if a 4.01 feature is supported but MAY attempt syntax and be prepared to handle <code>400 Bad Request</code> or <a href="#ResponseCode501NotImplemented"><code>501 Not Implemented</code></a></li>
</ol>
<hr />
<h1 id="appendix-a-references"><a name="References" href="#References">Appendix A. References</a></h1>
Expand Down
23 changes: 9 additions & 14 deletions docs/odata-protocol/odata-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ Section | Feature / Change | Issue
[Section 11.4](#DataModification)| Response code `204 No Content` after successful data modification if requested response could not be constructed| [443](https://github.com/oasis-tcs/odata-specs/issues/443)
[Section 11.4.4](#UpsertanEntity)| Upserts to single-valued non-containment navigation properties| [455](https://github.com/oasis-tcs/odata-specs/issues/455)
[Section 11.4.9.3](#UpdateaComplexProperty)| Setting a complex property to a different type| [534](https://github.com/oasis-tcs/odata-specs/issues/534)
[Section 12](#Conformance) | Allow `400 Bad Request` in addition to `501 Not Implemented` for unsupported functionality| [391](https://github.com/oasis-tcs/odata-specs/issues/391)
[Section 12.3](#InteroperableODataClients) | Encoding of plus character in URLs | [485](https://github.com/oasis-tcs/odata-specs/issues/485)

## <a name="Glossary" href="#Glossary">1.2 Glossary</a>
Expand Down Expand Up @@ -1919,7 +1920,7 @@ indicate service errors.
### <a name="ResponseCode501NotImplemented" href="#ResponseCode501NotImplemented">9.3.1 Response Code `501 Not Implemented`</a>

If the client requests functionality not implemented by the OData
Service, the service responds with `501 Not Implemented` and SHOULD
Service, the service MAY respond with `501 Not Implemented` and
include a response body describing the functionality not implemented.

## <a name="ErrorResponseBody" href="#ErrorResponseBody">9.4 Error Response Body</a>
Expand Down Expand Up @@ -6437,9 +6438,7 @@ request
([section 6](#Extensibility) and all subsections)
7. MUST successfully parse the request according to
[OData-ABNF](#ODataABNF) for any supported system query options and
either follow the specification or return
`501 Not Implemented` for any
unsupported functionality ([section 9.3.1](#ResponseCode501NotImplemented))
follow the specification or fail the request
8. MUST expose only data types defined in [OData-CSDLXML](#ODataCSDL)
9. MUST NOT require clients to understand any metadata or instance
annotations ([section 6.4](#VocabularyExtensibility)), custom headers ([section 6.5](#HeaderFieldExtensibility)), or custom
Expand Down Expand Up @@ -6505,9 +6504,8 @@ service:

1. MUST conform to the [OData 4.0 Minimal Conformance
Level](#OData40MinimalConformanceLevel)
2. MUST successfully parse the [OData-ABNF](#ODataABNF) and either
follow the specification or return `501 Not Implemented` for any
unsupported functionality ([section 9.3.1](#ResponseCode501NotImplemented))
2. MUST successfully parse the request according to [OData-ABNF](#ODataABNF) and
follow the specification or fail the request
3. MUST support `$select` ([section 11.2.5.1](#SystemQueryOptionselect))
4. MUST support casting to a derived type according to
[OData-URL](#ODataURL) if derived types are present in the model
Expand All @@ -6518,11 +6516,10 @@ unsupported functionality ([section 9.3.1](#ResponseCode501NotImplemented))
in the requested entity set ([section 11.2.6.1.1](#BuiltinFilterOperations))
2. MUST support aliases in `$filter` expressions ([section 11.2.6.1.3](#ParameterAliases))
3. SHOULD support additional filter operations ([section 11.2.6.1.1](#BuiltinFilterOperations))
and MUST return `501 Not Implemented` for any unsupported filter
operations ([section 9.3.1](#ResponseCode501NotImplemented))
and MUST fail the request for any unsupported filter
operations
4. SHOULD support the canonical functions ([section 11.2.6.1.2](#BuiltinQueryFunctions)) and
MUST return `501 Not Implemented` for any unsupported canonical
functions ([section 9.3.1](#ResponseCode501NotImplemented))
MUST fail the request for any unsupported canonical functions
5. SHOULD support `$filter` on expanded entities ([section 11.2.5.2.1](#ExpandOptions))
8. SHOULD publish metadata at `$metadata` according to
[OData-CSDLXML](#ODataCSDL) ([section 11.1.2](#MetadataDocumentRequest))
Expand Down Expand Up @@ -6789,9 +6786,7 @@ specified in `$metadata`
the requested format
21. SHOULD use capabilities (see [OData-VocCap](#ODataVocCap)) to
determine if a 4.01 feature is supported but MAY attempt syntax and be
prepared to handle either
[`501 Not Implemented`](#ResponseCode501NotImplemented) or
`400 Bad Request`
prepared to handle `400 Bad Request` or [`501 Not Implemented`](#ResponseCode501NotImplemented)


-------
Expand Down
1 change: 1 addition & 0 deletions odata-protocol/1 Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Response code `204 No Content` after successful data modification if requested r
[Section ##UpdateaComplexProperty]|
Setting a complex property to a different type|
[534](https://github.com/oasis-tcs/odata-specs/issues/534)
[Section ##Conformance] | Allow `400 Bad Request` in addition to `501 Not Implemented` for unsupported functionality| [391](https://github.com/oasis-tcs/odata-specs/issues/391)
[Section ##InteroperableODataClients] | Encoding of plus character in URLs | [485](https://github.com/oasis-tcs/odata-specs/issues/485)

## ##subsec Glossary
Expand Down
20 changes: 7 additions & 13 deletions odata-protocol/12 Conformance.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ request
([section ##Extensibility] and all subsections)
7. MUST successfully parse the request according to
[OData-ABNF](#ODataABNF) for any supported system query options and
either follow the specification or return
`501 Not Implemented` for any
unsupported functionality ([section ##ResponseCode501NotImplemented])
follow the specification or fail the request
8. MUST expose only data types defined in [OData-CSDLXML](#ODataCSDL)
9. MUST NOT require clients to understand any metadata or instance
annotations ([section ##VocabularyExtensibility]), custom headers ([section ##HeaderFieldExtensibility]), or custom
Expand Down Expand Up @@ -127,9 +125,8 @@ service:

1. MUST conform to the [OData 4.0 Minimal Conformance
Level](#OData40MinimalConformanceLevel)
2. MUST successfully parse the [OData-ABNF](#ODataABNF) and either
follow the specification or return `501 Not Implemented` for any
unsupported functionality ([section ##ResponseCode501NotImplemented])
2. MUST successfully parse the request according to [OData-ABNF](#ODataABNF) and
follow the specification or fail the request
3. MUST support `$select` ([section ##SystemQueryOptionselect])
4. MUST support casting to a derived type according to
[OData-URL](#ODataURL) if derived types are present in the model
Expand All @@ -140,11 +137,10 @@ unsupported functionality ([section ##ResponseCode501NotImplemented])
in the requested entity set ([section ##BuiltinFilterOperations])
2. MUST support aliases in `$filter` expressions ([section ##ParameterAliases])
3. SHOULD support additional filter operations ([section ##BuiltinFilterOperations])
and MUST return `501 Not Implemented` for any unsupported filter
operations ([section ##ResponseCode501NotImplemented])
and MUST fail the request for any unsupported filter
operations
4. SHOULD support the canonical functions ([section ##BuiltinQueryFunctions]) and
MUST return `501 Not Implemented` for any unsupported canonical
functions ([section ##ResponseCode501NotImplemented])
MUST fail the request for any unsupported canonical functions
5. SHOULD support `$filter` on expanded entities ([section ##ExpandOptions])
8. SHOULD publish metadata at `$metadata` according to
[OData-CSDLXML](#ODataCSDL) ([section ##MetadataDocumentRequest])
Expand Down Expand Up @@ -411,6 +407,4 @@ specified in `$metadata`
the requested format
21. SHOULD use capabilities (see [OData-VocCap](#ODataVocCap)) to
determine if a 4.01 feature is supported but MAY attempt syntax and be
prepared to handle either
[`501 Not Implemented`](#ResponseCode501NotImplemented) or
`400 Bad Request`
prepared to handle `400 Bad Request` or [`501 Not Implemented`](#ResponseCode501NotImplemented)
2 changes: 1 addition & 1 deletion odata-protocol/8 Header Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ indicate service errors.
### ##subsubsec Response Code `501 Not Implemented`

If the client requests functionality not implemented by the OData
Service, the service responds with `501 Not Implemented` and SHOULD
Service, the service MAY respond with `501 Not Implemented` and
include a response body describing the functionality not implemented.

## ##subsec Error Response Body
Expand Down

0 comments on commit 7f4c4e3

Please sign in to comment.