Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions packages/json_schemas/output/actor.ide.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,6 @@
"x-intellij-html-description": "<p>Path or direct definition of the Actor's input schema.</p>",
"markdownDescription": "Path or direct definition of the Actor's input schema."
},
"inputSchema": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/input-ide-json-2212166aa408babb6120b85f1282521a"
}
],
"description": "Path or direct definition of the Actor's input schema.",
"x-intellij-html-description": "<p>Path or direct definition of the Actor's input schema.</p>",
"markdownDescription": "Path or direct definition of the Actor's input schema."
},
"output": {
"oneOf": [
{
Expand Down
57 changes: 57 additions & 0 deletions packages/json_schemas/rules/modification-rules-schema.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://apify.com/json/modifications"
xmlns="https://apify.com/json/modifications"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<!-- Root element -->
<xs:element name="Enchantments">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element ref="AddDescription"/>
<xs:element ref="ReplaceValue"/>
<xs:element ref="RemoveValue"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>

<!-- AddDescription -->
<xs:simpleType name="AddDescriptionFormat">
<xs:restriction base="xs:string">
<xs:enumeration value="markdown"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="AddDescription">
<xs:complexType mixed="true">
<xs:attribute name="json-path" type="xs:string" use="required"/>
<xs:attribute name="format" type="AddDescriptionFormat" use="required"/>
</xs:complexType>
</xs:element>

<!-- ReplaceValue -->
<xs:simpleType name="ReplaceValueType">
<xs:restriction base="xs:string">
<xs:enumeration value="json"/>
<xs:enumeration value="js"/>
</xs:restriction>
</xs:simpleType>

<xs:element name="ReplaceValue">
<xs:complexType mixed="true">
<xs:attribute name="json-path" type="xs:string" use="required"/>
<xs:attribute name="type" type="ReplaceValueType" use="required"/>
</xs:complexType>
</xs:element>

<!-- RemoveValue -->
<xs:element name="RemoveValue">
<xs:complexType>
<xs:attribute name="json-path" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>

</xs:schema>
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
xsi:schemaLocation="https://apify.com/json/modifications ../modification-rules-schema.xsd">
<!-- REMOVE/REPLACE VALUES -->
<RemoveValue json-path="**/$id"/>
<RemoveValue json-path="/properties/inputSchema"/>
<!-- We need to use relative paths as later these will include json-schemas with descriptions -->
<ReplaceValue json-path="**/$ref" type="js">
value.replace(/^https:\/\/apify\.com\/schemas\/v1\/(.+)\.json/, '$1.ide.json')
</ReplaceValue>
<ReplaceValue json-path="/properties/inputSchema/oneOf" type="json">
[{ "type": "string" }, { "$ref": "input.ide.json" }]
</ReplaceValue>
<ReplaceValue json-path="/properties/input/oneOf" type="json">
[{ "type": "string" }, { "$ref": "input.ide.json" }]
</ReplaceValue>
Expand Down
Loading