Skip to content
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

Issue 305 #314

Closed
wants to merge 63 commits into from
Closed

Issue 305 #314

wants to merge 63 commits into from

Conversation

b-gran
Copy link

@b-gran b-gran commented Oct 27, 2016

Create independent APIs for

  • Retrieving, creating, modifying, and deleting documents (what's currently in operations.js)
  • Generating URIs from a model

@b-gran b-gran mentioned this pull request Oct 27, 2016
return value
}

return value
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a smart change! Just make this ternary a single line, for consistency.


class RESTPathGenerator {
constructor (apiPrefix = '', apiVersion = '', modelName) {
assert(typeof modelName === 'string', 'modelName must be a string')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably just throw here rather than use assert as a side effect

Copy link
Collaborator

@Zertz Zertz Oct 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, _.isString instead of typeof

@Zertz
Copy link
Collaborator

Zertz commented Oct 27, 2016

That's a heroic PR!

The one failing test is here, looks like something might have changed in the error response. Edit: We're getting failures on master as well, I'm guessing something changed yet again in how mongoose handles errors. Feel free to have a look at it, but it can be fixed separately too.

Great work, I added a few comments here and there, but looks good overall 👍

@Zertz Zertz added the feature label Oct 27, 2016
@b-gran
Copy link
Author

b-gran commented Oct 27, 2016

Thanks! Locally, I'm working on updates to the operations API that so that each op returns a Promise -- it's still failing a couple tests though, but I should be able to sort it out in the morning.

By the way, great work on this library!

@Zertz
Copy link
Collaborator

Zertz commented Oct 30, 2016

I'm keeping an eye out on this, let me know if you have any questions!

@coveralls
Copy link

coveralls commented Jan 16, 2017

Coverage Status

Coverage increased (+0.4%) to 99.468% when pulling 144fa51 on b-gran:issue-305 into e8e4063 on florianholzapfel:master.

@b-gran
Copy link
Author

b-gran commented Jan 20, 2017

Just realized the tests from #317 didn't make it in -- just added them.

@coveralls
Copy link

coveralls commented Jan 20, 2017

Coverage Status

Coverage increased (+0.4%) to 99.468% when pulling 55d0599 on b-gran:issue-305 into e8e4063 on florianholzapfel:master.

@coveralls
Copy link

coveralls commented Jan 20, 2017

Coverage Status

Coverage increased (+0.4%) to 99.465% when pulling 49a4345 on b-gran:issue-305 into e8e4063 on florianholzapfel:master.

@b-gran
Copy link
Author

b-gran commented Jan 26, 2017

Hey @Zertz, what do you think about moving to ES6 modules? The tooling supports it, but it means modifying the tests (which have nested require() calls, so can't generally be converted) like this:

const restify = require('../express-restify-mongoose').default

The changes are in a separate branch here if you want to see how it looks. That branch passes tests btw.

@coveralls
Copy link

coveralls commented Jan 26, 2017

Coverage Status

Coverage increased (+0.4%) to 99.459% when pulling cb0819b on b-gran:issue-305 into e8e4063 on florianholzapfel:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 99.459% when pulling cb0819b on b-gran:issue-305 into e8e4063 on florianholzapfel:master.

* Adds "Transformation" to represent an API method that *is*
 allowed to operate on requests
* Performs filtering of the request body in separate middleware
@coveralls
Copy link

coveralls commented Jan 28, 2017

Coverage Status

Coverage increased (+0.4%) to 99.465% when pulling 9b68b45 on b-gran:issue-305 into e8e4063 on florianholzapfel:master.

@b-gran
Copy link
Author

b-gran commented Jan 29, 2017

So I looked at the test that's failing and in 4.8.0 mongoose added support for selecting fields by array (the way the test attempts).

Should I update the test to document that new feature?

BTW here's the relevant test

Edit: it was actually an mquery update that added support for select()ing arrays and just got merged into mongoose:
mongoosejs/mquery@063d389

@coveralls
Copy link

coveralls commented Jan 30, 2017

Coverage Status

Coverage increased (+0.4%) to 99.465% when pulling b180b4d on b-gran:issue-305 into e8e4063 on florianholzapfel:master.

@coveralls
Copy link

coveralls commented Jan 30, 2017

Coverage Status

Coverage increased (+0.4%) to 99.465% when pulling 50e9d5d on b-gran:issue-305 into e8e4063 on florianholzapfel:master.

@b-gran b-gran mentioned this pull request Feb 19, 2017
@OmgImAlexis
Copy link

@b-gran is this still being worked on?

@Zertz
Copy link
Collaborator

Zertz commented Jun 10, 2018

I love the idea here but it seems like work has stalled and quite a few merge conflicts have risen and the scope of changes is quite large. Closing for now, let me know if there is interest in picking up the work.

@Zertz Zertz closed this Jun 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants