Method: W3cApi::Client.embed_supported_endpoints

Defined in:
lib/w3c_api/client.rb

.embed_supported_endpointsObject

Class method to list endpoints that support embed parameter



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/w3c_api/client.rb', line 11

def self.embed_supported_endpoints
  hal_instance = W3cApi::Hal.instance
  endpoints_with_embed = []

  hal_instance.register.models.each do |endpoint_id, endpoint_config|
    # Check if this endpoint has embed parameter support
    has_embed = endpoint_config[:parameters].any? do |param|
      param.name == "embed" && param.location == :query
    end

    endpoints_with_embed << endpoint_id if has_embed
  end

  endpoints_with_embed.sort
end