Project

General

Profile

Actions

Bug #3817

open

[API] Discovery document schema does not include generated fields like job dependencies

Added by Peter Amstutz about 10 years ago. Updated 9 months ago.

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

Description

schema_controller.rb:87:

        object_properties = {}
        k.columns.
          select { |col| col.name != 'id' }.
          collect do |col|
          if k.serialized_attributes.has_key? col.name
            object_properties[col.name] = {
              type: k.serialized_attributes[col.name].object_class.to_s
            }
          else
            object_properties[col.name] = {
              type: col.type
            }
          end
        end

This is introspecting over the internal SQL columns known to ActiveRecord, rather than the public data model declared in the 'api_accessible' stanzas of each subclass of ArvadosModel. This results in bugs such as Workbench recognizing fields on the internal SQL schema that are not intended for external consumption.

Fixing this is probably a prerequisite to #3818


Related issues

Related to Arvados - Feature #19929: Improve documentation in the discovery documentResolvedBrett SmithActions
Actions #1

Updated by Peter Amstutz about 10 years ago

  • Subject changed from Discovery document generates resource description based on ActiveRecord columns, not api_response. to [API] Discovery document generates resource description based on ActiveRecord columns, not api_response.
  • Description updated (diff)
  • Category set to API
Actions #2

Updated by Peter Amstutz about 10 years ago

  • Description updated (diff)
Actions #3

Updated by Peter Amstutz about 10 years ago

  • Description updated (diff)
Actions #4

Updated by Peter Amstutz about 10 years ago

  • Target version set to Arvados Future Sprints
Actions #5

Updated by Tom Clegg about 10 years ago

Note - even if the discovery doc uses api_response, clients will still learn about fields that are not returned to them in API responses, as long as there are distinct api_response templates used depending on context (e.g., whether the current user is_admin).

The existence of this bug report suggests that an instance has been discovered where the schema advertises an attribute that isn't in API responses. If so, what is the model/attribute?

Actions #6

Updated by Tom Clegg about 10 years ago

  • Subject changed from [API] Discovery document generates resource description based on ActiveRecord columns, not api_response. to [API] Discovery document schema does not include generated fields like job dependencies
  • Story points set to 1.0
Actions #7

Updated by Ward Vandewege over 3 years ago

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

Updated by Peter Amstutz almost 2 years ago

  • Release set to 60
Actions #9

Updated by Brett Smith almost 2 years ago

  • Related to Feature #19929: Improve documentation in the discovery document added
Actions #10

Updated by Peter Amstutz 9 months ago

  • Target version set to Future
Actions

Also available in: Atom PDF