wunderio / wunderhub

A central content repository for the WunderSites.
http://docs.wunderhub.apiary.io/
GNU General Public License v2.0
3 stars 3 forks source link

Add a submodule for WunderPrinciples content type and API endpoints #25

Closed joesb closed 8 years ago

joesb commented 8 years ago

This is mostly about me learning some D8 stuff, but also a nice bonus to the WunderHub API. Adds a Principles content type and Views API paths api/principles, api/principles/{uuid}

BUT, also custom code to add a WunderPrinciples zen API endpoint, in the style of https://api.github.com/zen, at api/principles/zen

joesb commented 8 years ago

This PR needs to be reviewed after #24 gets merged

lewisnyman commented 8 years ago

Hmm I get a weird error when trying to install this profile:

Starting Drupal installation. This takes a while. Consider using the --notify global option. [ok] exception 'Drupal\Core\Config\UnmetDependenciesException' with message 'Configuration objects [error](core.entity_form_display.user.user.default, views.view.team_listing) provided by wkhub_person have unmet dependencies' in /vagrant/drupal/current/core/lib/Drupal/Core/Config/UnmetDependenciesException.php:89 Stack trace:

0 /vagrant/drupal/c

joesb commented 8 years ago

Aah, maybe this is because the PR is based on the work prior to #24 - I probably need to rebase or something?

lewisnyman commented 8 years ago

This works great. The only suggestions I would make is:

  1. Including the principle description under api/zen, maybe we can use markdown formatting and a line break here?
  2. Filtering the principle endpoint by title instead of uuid. I think it would be much cleaner. I'm happy to open issues for these improvements though.
joesb commented 8 years ago

On your point 1, my build was following the style of https://api.github.com/zen, which only gives the one line, randomly from the options, and does not even return it as JSON data.

For me, the api/principles/zen endpoint is more an easter egg.

joesb commented 8 years ago

On your point 2, I just wonder whether that could cause a problem given that the titles won't necessarily be stable - someone edits a title and the data URL disappears

joesb commented 8 years ago

We can easily add URL query options for filtering by title, tho

lewisnyman commented 8 years ago
  1. Ok cool, that makes sense.
  2. Ok good point, I guess it needs some more thought and planning. Drupal usually maintains content alias' for titles that change right?