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

global: view configuration refactoring #64

Open
lnielsen opened this issue Apr 18, 2016 · 1 comment
Open

global: view configuration refactoring #64

lnielsen opened this issue Apr 18, 2016 · 1 comment
Assignees
Milestone

Comments

@lnielsen
Copy link
Member

Currently Records-REST can be configured with using the RECORDS_REST_ENDPOINTS variable with takes a long list of arguments.

Problem:

We are adding more and more options to the list of configuration variables. Each time an option is added, it needs to be propagated down through views. This causes quite a lot of boiler plate code, and possibilities for improper configuration.

Also, it is hard to reuse and repurpose the Records REST API for e.g. the deposit API.

Proposal:

  1. Wrap all configuration options in an object, so that just one object is passed around
  2. Create a endpoint context for each request, so it's easier to override behaviour in e.g. deposit.

Co-authored-by: @jirikuncar

@hachreak
Copy link
Member

IMHO maybe invenio-records-rest can be simplified moving:

  • the rest-specific code as this inside invenio-rest.
  • refactor the records rest specific code like a series of utilities ready-to-use.

Then, avoid a single point of configuration like create_blueprint() to permit to the single implementation like deposit to:

  • quickly implement its views because most of the code is already done
  • applying the behavior that it prefers because it has the full control of the request flow (like which error codes returns or the endpoint names)
  • cutting out the functionalities and configurations that it doesn't need.

@lnielsen lnielsen modified the milestones: someday, v1.0.0 May 18, 2017
@lnielsen lnielsen changed the title global: view configuration refactoring (blocker for release) global: view configuration refactoring Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants