fusio icon indicating copy to clipboard operation
fusio copied to clipboard

Fusio Schema question

Open nsherzog opened this issue 1 year ago • 1 comments

I'm trying to get my schema to show up in either ReDoc or Swagger-ui. I've designed it both freehand and using Fusio's designer and the app has verified the schema style successfully and set it correctly under 'Operation' but it never shows up in either of the documentation modules. Is there a step or a required part of the schema that I'm missing?

Current schema looks like this:

{ "id": 3, "status": 1, "name": "profileExport", "source": { "definitions": { "Contact": { "description": "facility contact information", "type": "object", "properties": { "FacilityName": { "description": "name of facility", "type": "string" }, "Institution": { "description": "name of facility's institution", "type": "string" }, "RORID": { "description": "the ror id assigned to institution", "type": "string" }, "Website": { "description": "website of facility typically hosted by institution", "type": "string" }, "AltLink2": { "description": "alternative coremarketplace profile link for facility", "type": "string" }, "OrderProcurementURL": { "description": "url for facility management software, if used", "type": "string" } } }, "PrimaryContact": { "description": "primary contacts for facility", "type": "object", "$extends": "Contact", "properties": { "Name": { "description": "full name of facility manager", "type": "string" }, "Phone": { "description": "phone number of facility manager", "type": "string" } } } } }, "readonly": false }

nsherzog avatar Oct 08 '24 13:10 nsherzog

Hi @nsherzog,

everything look good you only need to specify a root schema so that Fusio knows which type should be used from the definitions list, at UI there is also a "primary" button which does this s.

{
  "definitions": {
    "Contact": {
      "description": "facility contact information",
      "type": "object",
      "properties": {
        "FacilityName": {
          "description": "name of facility",
          "type": "string"
        },
        "Institution": {
          "description": "name of facility's institution",
          "type": "string"
        },
        "RORID": {
          "description": "the ror id assigned to institution",
          "type": "string"
        },
        "Website": {
          "description": "website of facility typically hosted by institution",
          "type": "string"
        },
        "AltLink2": {
          "description": "alternative coremarketplace profile link for facility",
          "type": "string"
        },
        "OrderProcurementURL": {
          "description": "url for facility management software, if used",
          "type": "string"
        }
      }
    },
    "PrimaryContact": {
      "description": "primary contacts for facility",
      "type": "object",
      "$extends": "Contact",
      "properties": {
        "Name": {
          "description": "full name of facility manager",
          "type": "string"
        },
        "Phone": {
          "description": "phone number of facility manager",
          "type": "string"
        }
      }
    }
  },
  "$ref": "PrimaryContact"
}

chriskapp avatar Oct 08 '24 16:10 chriskapp