2017-02-16 49 views

回答

1

为肾错构瘤1可以使用file type,如:

... 
types: 
    userPicture: 
    type: file 
    fileTypes: ['image/jpeg'] 
    maxLength: 307200 

... 
/images/{imageId}: 
    get: 
    responses: 
     200: 
     body: 
      image/jpeg: 
      type: userPicture 

For RAML 0.8 the file type is only aplicable to formParameters.

但你仍然可以使用的媒体类型,例如:

/images/{imageId}: 
    get: 
    responses: 
     200: 
     body: 
      image/jpeg: 
      description: an image... 
+0

我想这代码,但它是为RAML 1.0,我使用0.8版本。我做的工作方式并没有提到userPicture类型 –

+0

完美,正是我所做的:) –