apioo / fusio

Open source API management platform
https://www.fusio-project.org
Apache License 2.0
1.86k stars 222 forks source link

Fusio Schema question #585

Open nsherzog opened 2 days ago

nsherzog commented 2 days ago

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 }

chriskapp commented 2 days ago

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"
}