From 08ca3ccb4d69ccc615953c59444935dfd09122c5 Mon Sep 17 00:00:00 2001 From: Amon Sawamura Date: Fri, 6 Mar 2026 12:44:10 +0100 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20ComponentPropertyDefinition=20/=20C?= =?UTF-8?q?omponentProperty=20=E3=82=92=20type=20=E5=88=A5=E3=82=B9?= =?UTF-8?q?=E3=82=AD=E3=83=BC=E3=83=9E=E3=81=AB=E5=88=86=E5=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit plainbrew/figma-rest-api-spec#2 の変更を適用。 Co-Authored-By: Claude Sonnet 4.6 --- packages/figma-rest-api-spec/openapi.yaml | 159 +++++++++++++++++++--- 1 file changed, 139 insertions(+), 20 deletions(-) diff --git a/packages/figma-rest-api-spec/openapi.yaml b/packages/figma-rest-api-spec/openapi.yaml index c0778d1..de0fc76 100644 --- a/packages/figma-rest-api-spec/openapi.yaml +++ b/packages/figma-rest-api-spec/openapi.yaml @@ -5487,50 +5487,147 @@ components: - type - key ComponentPropertyDefinition: - type: object description: A property of a component. + oneOf: + - $ref: "#/components/schemas/BooleanComponentPropertyDefinition" + - $ref: "#/components/schemas/TextComponentPropertyDefinition" + - $ref: "#/components/schemas/VariantComponentPropertyDefinition" + - $ref: "#/components/schemas/InstanceSwapComponentPropertyDefinition" + discriminator: + propertyName: type + mapping: + BOOLEAN: "#/components/schemas/BooleanComponentPropertyDefinition" + TEXT: "#/components/schemas/TextComponentPropertyDefinition" + VARIANT: "#/components/schemas/VariantComponentPropertyDefinition" + INSTANCE_SWAP: "#/components/schemas/InstanceSwapComponentPropertyDefinition" + BooleanComponentPropertyDefinition: + type: object + description: A boolean property of a component. properties: type: - $ref: "#/components/schemas/ComponentPropertyType" + type: string + enum: + - BOOLEAN description: Type of this component property. defaultValue: - oneOf: - - type: boolean - - type: string + type: boolean + description: Initial value of this property for instances. + required: + - type + - defaultValue + TextComponentPropertyDefinition: + type: object + description: A text property of a component. + properties: + type: + type: string + enum: + - TEXT + description: Type of this component property. + defaultValue: + type: string + description: Initial value of this property for instances. + required: + - type + - defaultValue + VariantComponentPropertyDefinition: + type: object + description: A variant property of a component. + properties: + type: + type: string + enum: + - VARIANT + description: Type of this component property. + defaultValue: + type: string description: Initial value of this property for instances. variantOptions: type: array items: type: string - description: All possible values for this property. Only exists on VARIANT - properties. + description: All possible values for this property. + required: + - type + - defaultValue + - variantOptions + InstanceSwapComponentPropertyDefinition: + type: object + description: An instance swap property of a component. + properties: + type: + type: string + enum: + - INSTANCE_SWAP + description: Type of this component property. + defaultValue: + type: string + description: Initial value of this property for instances. preferredValues: type: array items: $ref: "#/components/schemas/InstanceSwapPreferredValue" - description: Preferred values for this property. Only applicable if type is - `INSTANCE_SWAP`. + description: Preferred values for this property. required: - type - defaultValue + - preferredValues ComponentProperty: - type: object description: A property of a component. + oneOf: + - $ref: "#/components/schemas/BooleanComponentProperty" + - $ref: "#/components/schemas/TextComponentProperty" + - $ref: "#/components/schemas/VariantComponentProperty" + - $ref: "#/components/schemas/InstanceSwapComponentProperty" + discriminator: + propertyName: type + mapping: + BOOLEAN: "#/components/schemas/BooleanComponentProperty" + TEXT: "#/components/schemas/TextComponentProperty" + VARIANT: "#/components/schemas/VariantComponentProperty" + INSTANCE_SWAP: "#/components/schemas/InstanceSwapComponentProperty" + BooleanComponentProperty: + type: object + description: A boolean property of a component. properties: type: - $ref: "#/components/schemas/ComponentPropertyType" + type: string + enum: + - BOOLEAN description: Type of this component property. value: - oneOf: - - type: boolean - - type: string + type: boolean + description: Value of the property for this component instance. + required: + - type + - value + TextComponentProperty: + type: object + description: A text property of a component. + properties: + type: + type: string + enum: + - TEXT + description: Type of this component property. + value: + type: string + description: Value of the property for this component instance. + required: + - type + - value + VariantComponentProperty: + type: object + description: A variant property of a component. + properties: + type: + type: string + enum: + - VARIANT + description: Type of this component property. + value: + type: string description: Value of the property for this component instance. - preferredValues: - type: array - items: - $ref: "#/components/schemas/InstanceSwapPreferredValue" - description: Preferred values for this property. Only applicable if type is - `INSTANCE_SWAP`. boundVariables: type: object description: The variables bound to a particular field on this component property @@ -5540,6 +5637,28 @@ components: required: - type - value + - boundVariables + InstanceSwapComponentProperty: + type: object + description: An instance swap property of a component. + properties: + type: + type: string + enum: + - INSTANCE_SWAP + description: Type of this component property. + value: + type: string + description: Value of the property for this component instance. + preferredValues: + type: array + items: + $ref: "#/components/schemas/InstanceSwapPreferredValue" + description: Preferred values for this property. + required: + - type + - value + - preferredValues Overrides: type: object description: Fields directly overridden on an instance. Inherited overrides are From 71fcd480982e532f384b670a1f9c185fc5082ab6 Mon Sep 17 00:00:00 2001 From: Amon Sawamura Date: Fri, 6 Mar 2026 12:47:38 +0100 Subject: [PATCH 2/3] changeset --- .changeset/young-islands-open.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/young-islands-open.md diff --git a/.changeset/young-islands-open.md b/.changeset/young-islands-open.md new file mode 100644 index 0000000..362d7d4 --- /dev/null +++ b/.changeset/young-islands-open.md @@ -0,0 +1,5 @@ +--- +"@plainbrew/figma-rest-api-spec": minor +--- + +ComponentPropertyDefinition / ComponentProperty を type 別スキーマに分割 From c90e1c56d143ee0a4481f3dd0588c3381c42cbd2 Mon Sep 17 00:00:00 2001 From: Amon Sawamura Date: Sun, 8 Mar 2026 07:33:43 +0100 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20=E4=B8=8D=E8=A6=81=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=9F=20ComponentPropertyType=20=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- packages/figma-rest-api-spec/openapi.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/figma-rest-api-spec/openapi.yaml b/packages/figma-rest-api-spec/openapi.yaml index de0fc76..9e683b0 100644 --- a/packages/figma-rest-api-spec/openapi.yaml +++ b/packages/figma-rest-api-spec/openapi.yaml @@ -5462,14 +5462,6 @@ components: letterSpacing: $ref: "#/components/schemas/VariableAlias" - $ref: "#/components/schemas/BaseTypeStyle" - ComponentPropertyType: - type: string - description: Component property type. - enum: - - BOOLEAN - - INSTANCE_SWAP - - TEXT - - VARIANT InstanceSwapPreferredValue: type: object description: Instance swap preferred value.