Skip to content

Commit a309923

Browse files
authored
Merge pull request #181 from akeneo/API_543
Add media file on product models
2 parents 2b8219e + 7e05322 commit a309923

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

content/swagger/resources/media_files/routes/media_files.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ get:
117117
post:
118118
summary: Create a new media file
119119
operationId: "post_media_files"
120-
description: This endpoint allows you to create a new media file and associate it to the product value of a given product.
120+
description: This endpoint allows you to create a new media file and associate it to an attribute value of a given product or product model.
121121
tags:
122122
- Media files
123123
x-versions:
@@ -133,10 +133,14 @@ post:
133133
in: body
134134
x-form-data: true
135135
schema:
136+
required: ["file"]
136137
properties:
137138
product:
138139
type: string
139-
description: The product to which the media file will be associated. It is a JSON string that follows this formula '{"identifier":"product_identifier", "attribute":"attribute_code", "scope":"channel_code","locale":"locale_code"}'
140+
description: The product to which the media file will be associated. It is a JSON string that follows this format '{"identifier":"product_identifier", "attribute":"attribute_code", "scope":"channel_code","locale":"locale_code"}'. You have to either use this field or the `product_model` field, but not both at the same time.
141+
product_model:
142+
type: string
143+
description: The product model to which the media file will be associated. It is a JSON string that follows this format '{"code":"product_model_code", "attribute":"attribute_code", "scope":"channel_code","locale":"locale_code"}'. You have to either use this field or the `product` field, but not both at the same time.
140144
file:
141145
type: string
142146
description: The binaries of the file

content/swagger/resources/token.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ post:
2424
x-form-data: true
2525
schema:
2626
type: object
27+
required: ["username", "password", "grant_type"]
2728
properties:
2829
username:
2930
type: string

src/api-reference/reference.handlebars

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@
162162
{{#each schema.properties}}
163163
<p>
164164
<code>{{@key}}</code>
165-
<a href="#" data-placement="top" data-toggle="tooltip" title="Required property"><i class="fa fa-asterisk fa-danger"></i></a>
165+
{{#if required}}
166+
<a href="#" data-placement="top" data-toggle="tooltip" title="Required property"><i class="fa fa-asterisk fa-danger"></i></a>
167+
{{/if}}
166168
<em>({{{type}}} {{#if format}} / {{{format}}}{{/if}})</em>
167169
<small>&bull; {{description}}</small>
168170
</p>

0 commit comments

Comments
 (0)