• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

opentrials / api
93%
master: 92%

Build:
Build:
LAST BUILD BRANCH: v1.1.1
DEFAULT BRANCH: master
Repo Added 09 Feb 2016 05:20PM UTC
Files 35
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH remove-unused-fields
branch: remove-unused-fields
CHANGE BRANCH
x
Reset
  • remove-unused-fields
  • 17-setup-docker
  • 23-automatic-deployment-to-staging
  • add-documents-files
  • add-install-instructions
  • add-location
  • add-on-delete-cascade
  • add-results-document
  • add-sources-terms-and-conditions
  • add-url-to-entities
  • add_csr_synopsis
  • adjust-garbage-collector
  • all-identifiers-are-the-same
  • api-docs
  • arthurSena/feature/661-audit-log-for-trial-deduplication
  • bug/173-fix-age-range
  • bug/429-fix-documents
  • bug/457-fix-python-bravado
  • bug/529-fix-running-linter
  • bug/542-fix-swagger-docs-over-https
  • bug/543-fix-trials.sources
  • bug/555-handle-files-without-pages
  • bug/725-fix-null-array-study-phases
  • bug/add-correct-completion-date-mapping
  • bug/add-e2e-sources-test
  • bug/fix-document-categories-migration
  • bug/fix-documents-uniqueness-constraints
  • bug/fix-intervention-types
  • bug/fix-issues-with-499
  • bug/limit-reindexing-memory-usage
  • bug/migration-race-condition
  • bug/records-source-id
  • bug/records-unique-constraint
  • bug/remove-nil-values-from-document-json-summary
  • bug/throw-crash
  • bug/trial-all-sources
  • bug/trial-sources-with-risks-of-bias
  • configure-aws-elasticsearch
  • data-discrepancies
  • downgrading-elasticsearch-to-1.5.2
  • enable-cors
  • fda-show-reviews-first
  • fda_approval_history_collector
  • feature/173-extract-age-range
  • feature/187-disable-seeds-in-production
  • feature/353-study-phase-as-array
  • feature/426-setup-sentry
  • feature/433-print-errors
  • feature/500-search-endpoint-for-fda
  • feature/501-add-fda-search-ui
  • feature/507-trials-n-to-n-documents
  • feature/557-reindex-one-page-at-a-time
  • feature/647-strict-elasticsearch-mapping
  • feature/651-disable-autocomplete-except-on-locations
  • feature/653-add-unkown-status
  • feature/708-change-pubmed-type
  • feature/709-expose-phase-data
  • feature/758-eliminate-trial-is-registered-property
  • feature/add-fields-to-trial-index
  • feature/add_is_primary_to_record
  • feature/add_last_verified_to_record
  • feature/add_results_exemption_date_to_trial
  • feature/allow-running-individual-indexers
  • feature/default-operator-should-be-and
  • feature/diffs-table
  • feature/document_categories_endpoint
  • feature/elasticsearch-aliases
  • feature/expose-all-entities-in-endpoints
  • feature/expose-trialrecords
  • feature/file-pages-preview
  • feature/ignore-ictrp-discrepancies
  • feature/migration-for-mapper
  • feature/natural-source-id
  • feature/performance-improvements
  • feature/remove-source-data-from-records
  • feature/replace-doc-type-with-category
  • feature/sort-fda-docs-by-application-and-date
  • feature/sort-trials-by-registration-date
  • feature/source-url-nullable
  • feature/trial-registered-boolean
  • feature/unique_constraint_records_source
  • feature/update-timestamps-in-postgres
  • feature/updated-database-docs
  • feature/updated-database-for-processors
  • feature/updated-publications
  • fix-api-spec
  • fix-seeds
  • fix-shrinkwrap
  • fix-stats-trials-per-year-empty-registration-date
  • fix/646-stop-reindex-at-es-error
  • fix/757-is_primary-should-not-be-none
  • fixes-to-fda-data
  • fixing-e2e-tests
  • hotfix/693-more-reindexing-issues
  • hotfix/693-reindexing-issues
  • hotfix/dates-without-offset
  • ignore-euctr-records-when-calculating-discrepancies
  • ignore-migrations-and-seeds-for-coverage
  • ignore-undefined-fields-for-discrepancy
  • ignore-whitespace-and-punctuation-for-discrepancies
  • import-schema
  • improve-reindexing-performance
  • improve-swagger-documentation
  • improvements-to-discrepancies
  • make-trials-recruitment-status-enumerable
  • master
  • reducing-memory-usage
  • refactor-our-reindexing-scripts
  • remove-locations-endpoint
  • remove-locations-url
  • remove-trials-trialrecords-table
  • remove-unused-documents-columns
  • remove_stats_endpoint
  • rename-problems-to-conditions
  • rename-trialrecords-to-records
  • search-endpoint
  • search-filters
  • split_recruitment_status_into_status
  • temp/deployment-example
  • testing-heroku-review-apps
  • trials-documents
  • trials-remove-not-null
  • trying-swagger-hapi
  • update-fields-used-to-calculate-discrepancies
  • updating-dependencies
  • upgrade-elasticsearch-2.3.5
  • upgrade-node-6
  • v1.0.0
  • v1.1.0
  • v1.1.1

pending completion
252

push

travis-ci

vitorbaptista
[#111] Simplify our API's responses

Now that many fields from pivot tables were removed, we can simplify our API's
responses. Mainly, relationships between Trials and other entities (for
example, Person) were changed from:

```javascript
{
  // trial's attributes ...
  persons: [
    {
      attributes: {
         id: 'foo',
         name: 'Joanne Smith',
      },
      role: 'principal_investigator',
    }
  ],
}
```

To:

```javascript
{
  // trial's attributes ...
  persons: [
    {
      id: 'foo',
      name: 'Joanne Smith',
      role: 'principal_investigator',
    }
  ],
}
```

This flattens a bit our API response, which makes it more readable in my
opinion. The issue is that attribute names in the model can clash with names in
the pivot tables. We could use, for example, underscores to identify model from
pivot table's attributes (`_role` instead of `role`), but I don't think that'll
be needed.

opentrials/opentrials#111

244 of 262 relevant lines covered (93.13%)

28.05 hits per line

Relevant lines Covered
Build:
Build:
262 RELEVANT LINES 244 COVERED LINES
28.05 HITS PER LINE
Source Files on remove-unused-fields
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
252 remove-unused-fields [#111] Simplify our API's responses Now that many fields from pivot tables were removed, we can simplify our API's responses. Mainly, relationships between Trials and other entities (for example, Person) were changed from: ```javascript { // t... push 24 May 2016 08:34AM UTC vitorbaptista travis-ci pending completion  
See All Builds (771)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc