Skip to content

Commit

Permalink
fix refs
Browse files Browse the repository at this point in the history
Signed-off-by: MUzairS15 <[email protected]>
  • Loading branch information
MUzairS15 committed Jul 1, 2024
1 parent 0d95948 commit 7d00193
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 36 deletions.
9 changes: 9 additions & 0 deletions schemas/constructs/openapi/models.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
openapi: 3.0.0
components:
schemas:
models:
$ref: ../v1beta1/model.json
components:
$ref: ../v1beta1/component.json
relationships:
$ref: ../v1alpha2/relationship.json
2 changes: 1 addition & 1 deletion schemas/constructs/v1alpha2/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"maxLength": 100,
"description": "API version of the object",
"pattern": "([a-z.])*(?!^\/)v(alpha|beta|[0-9]+)([.-]*[a-z0-9]+)*$",
"examples": [
"example": [
"v1",
"v1alpha1",
"v2beta3",
Expand Down
24 changes: 12 additions & 12 deletions schemas/constructs/v1alpha2/relationship.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"type": "object",
"properties": {
"schemaVersion": {
"$ref": "https://schemas.meshery.io/v1alpha2/core.json#versionString",
"$ref": "./core.json#/definitions/versionString",
"description": "Specifies the version of the schema used for the definition."
},
"version": {
"$ref": "https://schemas.meshery.io/v1alpha2/core.json#semverString",
"$ref": "./core.json#/definitions/semverString",
"description": "Specifies the version of the definition."
},
"kind": {
"$ref": "https://schemas.meshery.io/core.json#inputString",
"$ref": "./core.json#/definitions/inputString",
"description": "Kind of the Relationship.",
"enum": [
"hierarchical",
Expand All @@ -32,29 +32,29 @@
]
},
"type": {
"$ref": "https://schemas.meshery.io/core.json#inputString",
"$ref": "./core.json#/definitions/inputString",
"description": "Classification of relationships. Used to group relationships similar in nature."
},
"subType": {
"$ref": "https://schemas.meshery.io/core.json#inputString",
"$ref": "./core.json#/definitions/inputString",
"description": "Used for further classification of Relationships. Type and SubType together identifies a Relationship."
},
"evaluationQuery": {
"$ref": "https://schemas.meshery.io/core.json#inputString",
"$ref": "./core.json#/definitions/inputString",
"description": "Determines the policy rule to be used for the evaluation of the relationship."
},
"metadata": {
"type": "object",
"description": "Metadata contains additional information associated with the Relationship.",
"properties": {
"description": {
"$ref": "https://schemas.meshery.io/core.json#inputString",
"$ref": "./core.json#/definitions/inputString",
"description": "Description of the Relationship."
}
}
},
"model": {
"$ref": "https://schemas.meshery.io/v1alpha1/model.json",
"$ref": "../v1beta1/model.json",
"description": "Model of the Relationship."
},
"selectors": {
Expand All @@ -78,10 +78,10 @@
],
"properties": {
"from": {
"$ref": "https://schemas.meshery.io/v1alpha2/selectors.json#from"
"$ref": "./selectors.json#/from"
},
"to": {
"$ref": "https://schemas.meshery.io/v1alpha2/selectors.json#to"
"$ref": "./selectors.json#/to"
}
}
},
Expand All @@ -94,10 +94,10 @@
],
"properties": {
"from": {
"$ref": "https://schemas.meshery.io/v1alpha2/selectors.json#from"
"$ref": "./selectors.json#/from"
},
"to": {
"$ref": "https://schemas.meshery.io/v1alpha2/selectors.json#to"
"$ref": "./selectors.json#/to"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions schemas/constructs/v1alpha2/selectors.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"type": "string"
},
"model": {
"$ref": "https://schemas.meshery.io/v1beta1/model.json#",
"$ref": "../v1beta1/model.json",
"description": "Model of the component. Learn more at https://docs.meshery.io/concepts/models"
},
"version": {
"$ref": "https://schemas.meshery.io/v1alpha2/core.json#versionString"
"$ref": "./core.json#/definitions/semverString"
},
"match": {
"type": "object",
Expand Down Expand Up @@ -76,11 +76,11 @@
"type": "string"
},
"model": {
"$ref": "https://schemas.meshery.io/v1beta1/model.json#",
"$ref": "../v1beta1/model.json",
"description": "Model of the component. Learn more at https://docs.meshery.io/concepts/models"
},
"version": {
"$ref": "https://schemas.meshery.io/v1alpha2/core.json#versionString"
"$ref": "./core.json#/definitions/semverString"
},
"match": {
"type": "object",
Expand Down
8 changes: 4 additions & 4 deletions schemas/constructs/v1beta1/component.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"type": "object",
"properties": {
"schemaVersion": {
"$ref": "https://schemas.meshery.io/v1alpha2/core.json#versionString",
"$ref": "../v1alpha2/core.json#/definitions/versionString",
"description": "Specifies the version of the schema to which the component definition conforms."
},
"version": {
"$ref": "https://schemas.meshery.io/v1alpha2/core.json#semverString",
"$ref": "../v1alpha2/core.json#/definitions/semverString",
"description": "Version of the component definition.",
"minLength": 1,
"maxLength": 50
},
"displayName": {
"$ref": "https://schemas.meshery.io/v1alpha2/core.json#inputString",
"$ref": "../v1alpha2/core.json#/definitions/inputString",
"description": "Name of the component in human-readible format."
},
"description": {
Expand All @@ -30,7 +30,7 @@
"description": "Format specifies the format used in the `component.schema` field. JSON is the default."
},
"model": {
"$ref": "https://schemas.meshery.io/v1alpha1/model.json#",
"$ref": "./model.json",
"description": "Reference to the specific registered model to which the component belongs and from which model version, category, and other properties may be referenced. Learn more at https://docs.meshery.io/concepts/models"
},
"metadata": {
Expand Down
39 changes: 25 additions & 14 deletions schemas/constructs/v1beta1/model.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
"type": "object",
"properties": {
"schemaVersion": {
"$ref": "https://schemas.meshery.io/v1alpha2/core.json#versionString",
"$ref": "../v1alpha2/core.json#/definitions/versionString",
"description": "Specifies the version of the schema used for the definition.",
"minLength": 1,
"maxLength": 50
},
"version": {
"$ref": "https://schemas.meshery.io/v1alpha2/core.json#semverString",
"$ref": "../v1alpha2/core.json#/definitions/semverString",
"description": "Version of the model definition."
},
"name": {
"$ref": "https://schemas.meshery.io/core.json#inputString",
"$ref": "../v1alpha2/core.json#/definitions/inputString",
"description": "The unique name for the model within the scope of a registrant.",
"minLength": 1,
"maxLength": 100
},
"displayName": {
"$ref": "https://schemas.meshery.io/core.json#inputString",
"$ref": "../v1alpha2/core.json#/definitions/inputString",
"description": "Human-readable name for the model.",
"minLength": 1,
"maxLength": 100
Expand All @@ -36,13 +36,14 @@
"status": {
"type": "string",
"description": "Status of model, including:\n- duplicate: this component is a duplicate of another. The component that is to be the canonical reference and that is duplicated by other components should not be assigned the 'duplicate' status.\n- maintenance: model is unavailable for a period of time.\n- enabled: model is available for use for all users of this Meshery Server.\n- ignored: model is unavailable for use for all users of this Meshery Server.",
"enum": ["ignored", "enabled", "duplicate"]
"enum": [
"ignored",
"enabled",
"duplicate"
]
},
"registrant": {
"$ref": "../v1alpha2/connections.yaml#/components/schemas/connection",
"description": "Kind of the connection responsible for sourcing and registering entities related to this model.",
"minLength": 1,
"maxLength": 100
"type": "object"
},
"category": {
"type": "string",
Expand All @@ -59,7 +60,10 @@
"metadata": {
"type": "object",
"description": "Metadata containing additional information associated with the model.",
"required": ["name", "version"],
"required": [
"name",
"version"
],
"properties": {
"isAnnotation": {
"type": "boolean",
Expand Down Expand Up @@ -98,16 +102,23 @@
"model": {
"type": "object",
"description": "Registrant-defined data associated with the model.",
"required": ["version"],
"required": [
"version"
],
"properties": {
"version": {
"$ref": "https://schemas.meshery.io/v1alpha2/core.json#versionString",
"$ref": "../v1alpha2/core.json#/definitions/versionString",
"description": "Version of the model as defined by the registrant.",
"minLength": 1,
"maxLength": 100
}
}
}
},
"required": ["name", "version", "registrant", "category"]
}
"required": [
"name",
"version",
"registrant",
"category"
]
}
2 changes: 1 addition & 1 deletion scripts/merge-openapi-specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo $folderName
process_spec() {
echo "processing $1 ..."
name=$(basename $1)
redocly bundle $1 -o "$temp_bundle_dir/$name"
redocly bundle --dereferenced $1 -o "$temp_bundle_dir/$name"
echo "\n"
}

Expand Down

0 comments on commit 7d00193

Please sign in to comment.