Skip to content

Adding Swagger example files for all of ADLA and ADLS#9

Merged
begoldsm merged 1 commit intobegoldsm:masterfrom
ro-joowan:master
Jul 12, 2017
Merged

Adding Swagger example files for all of ADLA and ADLS#9
begoldsm merged 1 commit intobegoldsm:masterfrom
ro-joowan:master

Conversation

@ro-joowan
Copy link
Copy Markdown

There are three pending issues with this change that were already discussed with the Swagger team. These errors are from the oav while calling "oav validate-example filesystem.json." Every Swagger file passed these tests except filesystem.json and its example files.

  1. Because we were running into an "EQUIVALENT_PATH" error, we moved the paths into "x-ms-paths" and differentiated each path by inserting the "op" query and its associated constant string value into the path. We ran into the following form of error for all those paths:
error: Found errors in validating the request for x-ms-example "Creates a directory" in operation "FileSystem_Mkdirs".:

{ code: 'REQUEST_VALIDATION_ERROR',
  message: 'Found errors in validating the request for x-ms-example "Creates a directory" in operation "FileSystem_Mkdirs".',
  innerErrors:
   [ { code: 'INVALID_REQUEST_PARAMETER',
       errors:
        [ { code: 'REQUIRED',
            message: 'Value is required but was not provided',
            path:
             [ 'paths',
               '/webhdfs/v1/{path}?op=MKDIRS',
               'put',
               'parameters',
               '0' ] } ],
       in: 'path',
       message: 'Invalid parameter (path): Value is required but was not provided',
       name: 'path',
       path: { '$ref': '$["innerErrors"][0]["errors"][0]["path"]' } } ] }
  1. There is currently no support for "application/octet-stream," which produced this error:
error: Found errors in validating the request for x-ms-example "Appends to the specified file, optionally first creating the file if it does not yet ex
ist. This method supports multiple concurrent appends to the file. NOTE: The target must not contain data added by Create or normal (serial) Append. Co
ncurrentAppend and Append cannot be used interchangeably; once a target file has been modified using either of these append options, the other append o
ption cannot be used on the target file. ConcurrentAppend does not guarantee order and can result in duplicated data landing in the target file" in ope
ration "FileSystem_ConcurrentAppend".:

{ code: 'REQUEST_VALIDATION_ERROR',
  message: 'Found errors in validating the request for x-ms-example "Appends to the specified file, optionally first creating the file if it does not y
et exist. This method supports multiple concurrent appends to the file. NOTE: The target must not contain data added by Create or normal (serial) Appen
d. ConcurrentAppend and Append cannot be used interchangeably; once a target file has been modified using either of these append options, the other app
end option cannot be used on the target file. ConcurrentAppend does not guarantee order and can result in duplicated data landing in the target file" i
n operation "FileSystem_ConcurrentAppend".',
  innerErrors:
   [ { code: 'INVALID_CONTENT_TYPE',
       message: 'Invalid Content-Type (application/json).  These are supported: application/octet-stream',
       path: [] } ] }
  1. Similarly to 2 above, there seems to be no support for returning "file" types in the response body:
error: Found errors in validating the response with statusCode "200" for x-ms-example "Opens and reads from the specified file" in operation "FileSyste
m_Open".:

{ code: 'RESPONSE_VALIDATION_ERROR',
  message: 'Found errors in validating the response with statusCode "200" for x-ms-example "Opens and reads from the specified file" in operation "File
System_Open".',
  innerErrors:
   [ { code: 'INVALID_RESPONSE_BODY',
       errors:
        [ { code: undefined,
            message: 'Invalid \'type\' value: file',
            path: undefined } ],
       message: 'Invalid body: Invalid \'type\' value: file',
       path: [] } ] }

Not completely done -- trying to address an x-ms-path issue with the Swagger team.
@begoldsm begoldsm merged commit d23e9ad into begoldsm:master Jul 12, 2017
begoldsm pushed a commit that referenced this pull request Jul 12, 2017
This takes all of the new x-ms-examples from PR:
* #9

And puts them into the correct format for the new branch structure.
veronicagg pushed a commit to Azure/azure-rest-api-specs that referenced this pull request Jul 15, 2017
* Make readOnly properties readOnly

* Translation of master -> current for ADL

This takes all of the new x-ms-examples from PR:
* begoldsm#9

And puts them into the correct format for the new branch structure.

* Fix pathing and add newlines

Added new lines to the end of all example files to make GitHub happy.
Fixed the ../examples to be ./examples due to the new folder structure.

* Undoing readOnly change for this PR

Current PR is focused only on adding examples. I will make functional
updates to the spec in a separate branch.

* Fixes to specs due to missing requirements

Fixed query params and moved one operation back into "paths" due to
missing requirements documented in this github issue:
Azure/autorest#2440

* Update examples to include OP now.

* Fix a couple validation issues

1. copy paste fail for LISTSTATUS
2. A change that should be in a different branch ended up in this PR.
Reverted it (for the account_list payload).

* Fix validation error because exception is required.

* Missed the x-ms-azure-resource tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants