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 別スキーマに分割 diff --git a/packages/figma-rest-api-spec/openapi.yaml b/packages/figma-rest-api-spec/openapi.yaml index c0778d1..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. @@ -5487,50 +5479,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 +5629,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