-
-
Notifications
You must be signed in to change notification settings - Fork 113
bugfix: duplicate properties (#276) #301
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
bugfix: duplicate properties (#276) #301
Conversation
@jenweber Looking at a shorter version of the response data from server for json api adapter, one case where we see duplicates, it looks like we have an extra piece of information we could use to figure out the most local entity with confidence. Short JSON API doc{
"data": {
"id": "ember-data-2.14.6-DS.RESTAdapter",
"type": "class",
"attributes": {
"extends": "DS.Adapter",
"file": "addon/adapters/rest.js",
"uses": [
"DS.BuildURLMixin"
],
"methods": [
{
"name": "createRecord",
"file": "addon/adapters/rest.js"
},
{
"name": "createRecord",
"file": "addon/adapter.js"
}
]
},
"relationships": {
"parent-class": {
"data": {
"id": "ember-data-2.14.6-DS.Adapter",
"type": "class"
}
},
"descendants": {
"data": [
{
"type": "class",
"id": "ember-data-2.14.6-DS.JSONAPIAdapter"
}
]
},
"module": {
"data": {
"id": "ember-data-2.14.6-ember-data",
"type": "module"
}
},
"project-version": {
"data": {
"id": "ember-data-2.14.6",
"type": "project-version"
}
}
}
}
} The module has a On the matter of tests, may be an acceptance test would suffice. We could probably use the rest adapter or something similar to verify unique items & their sources (may be Sorry I couldn't put up this info sooner, hadn't investigated this issue until now 🙁 |
Don't merge yet. This needs another careful code review and a test. |
@jenweber I merged from master so that we could see your changes on the review app. Added a WIP prefix to keep us from hitting that green button :) |
@sivakumar-kailasam ok good, you were making me nervous, haha |
…er-api-docs into bugfix-duplicate-properties
Addresses #276
Whenever there are duplicate methods, the first one in the filtered list is the "most local," as far as I can see. If I'm reading the code right, it appears that this is how it was handled in the past as well.
One piece is missing: What would a good test be? It would be easy to write a test that asserts that there aren't duplicates, but I'm most concerned about the source data ordering changing somehow and that not being caught, resulting in the "less specific" documentation being shown. Suggestions? I can add a test before a merge. I'm PR'ing it now for easy testing/comparison/advice by a reviewer.
cc @sivakumar-kailasam @toddjordan