Project

General

Profile

Actions

Feature #3818

open

[API] Discovery document schema should include whether field on resource is writable or read-only.

Added by Peter Amstutz over 9 years ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
API
Target version:
Story points:
1.0
Release:
Release relationship:
Auto

Description

Read-only fields are:
  • modified_* and created_at (which are attr_protected)
  • updated_at (which should be either removed outright or protected with attr_protected)
  • (any others?)
Notes
  • attr_protected can surely be introspected, but is deprecated in rails 4.

Files

3818-try1.patch (11.8 KB) 3818-try1.patch Brett Smith, 03/29/2015 05:25 PM
Actions #1

Updated by Peter Amstutz over 9 years ago

  • Description updated (diff)
Actions #2

Updated by Peter Amstutz over 9 years ago

  • Subject changed from Discovery document should include whether field is writable or read-only. to Discovery document schema should include whether field on resource is writable or read-only.
Actions #3

Updated by Peter Amstutz over 9 years ago

  • Subject changed from Discovery document schema should include whether field on resource is writable or read-only. to [API] Discovery document schema should include whether field on resource is writable or read-only.
  • Category set to API
Actions #4

Updated by Peter Amstutz over 9 years ago

  • Target version set to Arvados Future Sprints
Actions #5

Updated by Tom Clegg over 9 years ago

  • Description updated (diff)
Actions #6

Updated by Peter Amstutz over 9 years ago

  • Story points set to 1.0
Actions #7

Updated by Brett Smith about 9 years ago

I started going down this path to try to address an issue I was encountering in #4253. I eventually found out that Workbench has other infrastructure to solve my issue, so I switched to using that, but here's my work in progress for posterity.

This patch hacks up the schema controller to put all API attributes in the discovery document, whether they're in the database or not. It also marks non-database attributes as readonly. It could be extended to advertise that flag for other protected attributes without too much trouble.

This patch also starts teaching Workbench to deal with the newly-advertised attributes correctly. What's left to be done is to clean up some of the workaround code that Workbench already has for cases like these. That's necessary to avoid conflicts between the new handling code and the old handling code: a handful of Workbench tests are failing after this patch.

Actions #8

Updated by Peter Amstutz almost 3 years ago

  • Target version deleted (Arvados Future Sprints)
Actions #9

Updated by Peter Amstutz about 1 year ago

  • Release set to 60
Actions #10

Updated by Peter Amstutz about 2 months ago

  • Target version set to Future
Actions

Also available in: Atom PDF