-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RCP-039 - Web API Core 2.1.0 Specification #22
Comments
Will this requirement be "at least one of these resources is required, and if any are present, they must be available at the top level"? |
Yes, that's correct. I'll make sure to clarify that. We test this in Web API Core currently and at least one of Property, Member, Office, or Media is required at the top level. We'd be removing Media and perhaps adding some other top level items. Maybe OpenHouse, for example. We probably need a white list for DD 2.0/availability testing too. |
I know there is a pain point for @odata.nextLink involving $top The issue resolves around the definition of $top: Many expect that the @odata.nextLink should continue to appear and provide the links to obtain additional records after the number of records specified in the $top have been returned. Example: a search includes $top=10 and the server's page size is 1000. Should a @odata.nextLink be included? Another example: a search includes $top=1500 and the server's page size is 1000. How would @odata.nextLink function? |
Good question regarding
I believe that when If the client wanted to specify a requested page size with next link, it seems On another note, we removed string queries from the list of items above in the May 2022 Certification Subgroup meeting, but need a way to reconcile the situation and add them back in. cc: @psftc @SergioDelRioT4Bi @EnFinlay Web API Core currently tests single- and multi-enumerations, meaning that we can't currently certify anyone using the Lookup resource for enumerations until this has been addressed. This is the reason it was to be added to Core 2.1.0. One problem I see with case insensitivity is that it would create a scenario where if there were more than one variation of something, say CA and ca, the client wouldn't be able to specifically filter for one or the other without consuming all the records and doing so on the client side. This essentially just offloads the work the server is supposed to do in that case on clients. Why make more work for them if the server is already supposed to behave correctly in this case? In terms of what's in the payload, for any given standard enumeration, the case MUST match. If the server had both CA and ca in StateOrProvince, tests would fail. Being able to query using CA, cA, or ca makes things potentially more convenient in terms of queries, but only one value would ever be returned in this case, if it existed: CA. Similar is true for lookup names, the server MUST have StateOrProvince, not StateorProvince or stateorprovince as a lookup name. Clients are supposed to use Depending on the server collation, the potentially more "challenging" string queries are A question I have would be: what do the current server implementations of OData expect out of the box? For example the .Net OData server? I don't work with Microsoft technologies personally, and can't answer the question. But, we don't want to get into a scenario where we relax a restriction in the OData specification that breaks existing servers or clients. I believe the Olingo server is lax in this regard. As an aside, we wouldn't change other open standards such as HTTP or OAuth2 because we didn't like something about them? What makes OData any different? It's not our standard to make changes to. The appropriate path in this case would be that someone from RESO would surface the issue with the OASIS OData team and ask for a change proposal. Perhaps @SergioDelRioT4Bi can take that on. |
If the client asks for a top of 10, then only 10 items should be returned. If 10 records can fit on a single page, then no next link should be provided. This example seems to be using top in place of the maxpagesize preference. If the page size is 10, and there are 15 records that match the query, then yes a next page link should be provided. The service should never return greater than the specified top: 11.2.6.3 System Query Option $top
If the service already returned n (10), why would it give a next link? It's not supposed to return any further records. 11.2.6.7 Server-Driven Paging
We can't ignore the $top portion of the request URL. The request URL specified n(10) records to return, and the response contained n(10) records. Therefore it's not a partial response. If $top is to be ignored for a specific function, then the Odata spec explicitly states so. For example $count explicitly states:
|
#22: Added Summary of Changes and Examples of Expanded Resources
reading through the notes, I'm not sure if this was covered...
|
Thank you for commenting and for the suggestion. There are some interesting facets to this:
There are a couple of ways we could approach the tests here. We could decide not to trust the counts, page as far as we can, and then verify that on the "last" page, there was no next link. We will need to set a page size small enough that we wouldn't consume the entire record set in one page. Another alternative is to choose a number of records and page size that every vendor should be able to support on every resource, and ensure that the next link isn't there in that case. The rules above take the latter approach:
Requesting one record for any resource that is being tested should always work, and we should never have more than one page in this case. People could potentially "cheat" the test by coding their servers to never return next link with one record, so we may want to add additional coverage, for instance we can try and go as far as we can, and wherever the pull stops, ensure that the last page didn't have data. Curious to hear any thoughts. |
There is mention in the OASIS documents System Query Option $count I found helpful:
|
Motion to Move Specification Forward Yes: 12, No: 0, Abstentions: 3 |
Even though we didn't vote for it today, I think due to the discussion about 429 requirements in #31 we could add some language to the Core 2.1.0 and Payloads 2.0 specs to require providers to use a 429 when rate limiting their consumers? We don't necessarily have to test for it, and it wouldn't necessarily be straightforward to test anyway, but we could put it in the spec? |
TODO: from 9/15 Cert meeting:
|
|
Thanks. The testing rules above were approved by the Workgroups and we're in the process of creating testing tools. |
I have been digging through specifications, but I only found ModificationTimestamp listed as a MUST for Lookup resource testing in DD 1.7 and 2.0 EDIT: Nevermind, Payloads Testing Specification has it
|
The key and timestamp requirements are part of the Payloads spec - RCP-038 - at the moment as part of Data Dictionary testing. OData also requires that every resource has a key. So not having the key field on all resources will fail the metadata validation tests anywhere they're done, which includes Web API and Data Dictionary + Payloads. |
@gr33neggs - we've been considering merging DD and Payloads but they're two separate proposals and stages at the moment. When DD 1.7 was first released, Payloads wasn't required. We added it for DD testing in August of 2022, so they could potentially be combined. That said, there may be reasons to keep them separate. We may want to validate Payloads beyond DD testing and RESO Common Format is more of a payloads test than DD. |
The RESO Certification Subgroup has requested a new Web API Core specification be created to include certain features like support for OData Expand and Server-Driven paging.
Support for Expanded Data Elements
/Property?$expand=Media
and the Property payload will be checked for a collection-based property called Media, and each result in the collection will be validated against the OData EntityType advertised in the metadata for Media./Property('XXXXX')/Media
whereXXXXX
is the key.Providers MUST Support Server-Driven Paging
Providers MUST support server-driven paging using
@odata.nextLink
.This functionality is needed so that data consumers may reliably consume data when only a partial result is returned and it’s classified as a MUST within OData Minimal Conformance Requirements (item 3) for version 4.0 and above.
Basic tests will be added in the Web API Core 2.1.0 tests, but the majority of nextLink testing will be done in the Payloads 2.0 Specification, which could result in a failure of nextLink-based operations even if the provider passed Web API Core 2.1.0 testing.
$top=1
. This should NOT contain@odata.nextLink
, since one record should be available, and we’ve reached the end of the set.@odata.nextLink
without any additional$filter
parameters to ensure that the data returned with each response doesn't match any of the previous responses.$filter
will also be tested. Since ModificationTimestamp is the only required field at this point, it will be used.$filter
request will be made for records greater than one year back using the timestamp field being tested in the Web API Core tests, and several pages (10+), will be fetched to ensure that each page has an@odata.nextLink
, when applicable. If the total number of records are fetched during this process, the last page will be checked to ensure there is no nextLink. This testing will be done using the greater than (gt
) operator.lt
) operator for records prior to the current timestamp.String Comparison Operators for Single- and Multi-Valued Enumerations
With the current Web API Core tests, both single- and multi-valued enumerations are tested for those using OData
Edm.EnumType
enumerations and eitherCollection(Edm.EnumType)
orEdm.EnumType
withIsFlags=true
.String-based enumerations were added to Data Dictionary 1.7+ using the Lookup resource. There is currently no way to test this case in Web API Core 2.0.0.
The following tests will be added to support this case:
GET /Property?$filter=StandardStatus eq 'Active'
GET /Property?$filter=StandardStatus ne 'Active'
GET /Property?$filter=AccessibilityFeatures/any(enum:enum eq 'Accessible Entrance' OR enum eq 'Visitable')
GET /Property?$filter=AccessibilityFeatures/all(enum:enum eq 'Accessible Entrance' OR enum eq 'Visitable')
in
operator was introduced to determine whether a given value is in a set of values. This is more convenient that writingField1 eq 'value1' OR Field1 eq 'value2' OR...
. IF the response header indicates that the OData version is "4.01", then thein
operator will be tested using a query similar to the following:GET /Property?$filter=StandardStatus in ('Active', 'Pending', 'Sold')
in
for multi-valued enumerations (usingany
andall
)The text was updated successfully, but these errors were encountered: