Skip to content

Referenced schema by relative URL #94

@wol-soft

Description

@wol-soft

@wol-soft
I actually get an error as well when trying to evaluate adcp get_products json schema

original https://adcontextprotocol.org/schemas/v2/media-buy/get-products-request.json

simplified:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/2.5.0/media-buy/get-products-request.json",
  "title": "Get Products Request",
  "description": "Request parameters for discovering available advertising products",
  "type": "object",
  "properties": {
    "brand_manifest": {
      "$ref": "/schemas/2.5.0/core/brand-manifest-ref.json",
      "description": "Brand information manifest providing brand context, assets, and product catalog. Can be provided inline or as a URL reference to a hosted manifest."
    }
}

brand-manifest-ref.json is this:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/2.5.0/core/brand-manifest-ref.json",
  "title": "Brand Manifest Reference",
  "description": "Brand manifest provided either as an inline object or a URL string pointing to a hosted manifest",
  "oneOf": [
    {
      "$ref": "/schemas/2.5.0/core/brand-manifest.json",
      "description": "Inline brand manifest object"
    },
    {
      "type": "string",
      "format": "uri",
      "description": "URL to a hosted brand manifest JSON file. The manifest at this URL must conform to the brand-manifest.json schema."
    }
  ]
}

this can be simplified to

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/2.5.0/media-buy/get-products-request.json",
  "title": "Get Products Request",
  "description": "Request parameters for discovering available advertising products",
  "type": "object",
  "properties": {
    "brand_manifest": {
     "oneOf": [
    {
      "$ref": "/schemas/2.5.0/core/brand-manifest.json",
      "description": "Inline brand manifest object"
    },
    {
      "type": "string",
      "format": "uri",
      "description": "URL to a hosted brand manifest JSON file. The manifest at this URL must conform to the brand-manifest.json schema."
    }
  ]
    }
}

which actually builds just fine (praise the lord, your lib is the only one that is able to do so). I wonder though if there is a simple fix without me having to copy paste certain contents around to make it work.

so to recap: it doesnt work the way it is online with reference to a new file

it does work if i copy paste the contents of said file into the property definition.

Originally posted by @LukasGoTom in #57

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions