RESTinstance icon indicating copy to clipboard operation
RESTinstance copied to clipboard

How to use OpenApiSpecification yaml

Open ZephyrusMB opened this issue 4 years ago • 3 comments

Hello, How is it possible to use your library with an OpenAPI 3.0 Specification yaml file? With the following code

*** Settings ***
Library  REST  url=http://localhost:8080  spec=petstore_openapi.yaml

*** Variables ***
&{dict}    type=1  #not used
*** Test Cases ***
test
    REST.Get     /api/v3/openapi.json

I get the error

test                                                                  | FAIL |
'request':
    - 'path':
        - "'type'"

How is it possible to use correctly the endpoint in the yaml and to pass parameters?

I'm using https://petstore3.swagger.io/ and the yaml https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml

Thank you

image

ZephyrusMB avatar Dec 06 '21 16:12 ZephyrusMB

Hi @MatteoBellarasa

Currently OpenApi v3 is not supported, because the Python dependency required for that (openapi-core) is still in beta and we didn't feel confident to add a potentially unstable dependency to this library. There is an open pull request (https://github.com/eficode/RESTinstance/pull/10) about this, where you can see the discussion.

asimell avatar Dec 07 '21 06:12 asimell

Thank you for your answer @asimell. What about v2? is it supported? If yes do you have any use case as example? And json format? The only example i could find is this one https://github.com/asyrjasalo/RESTinstance/issues/34 Thank you again for your patience and support.

ZephyrusMB avatar Dec 07 '21 09:12 ZephyrusMB

V2 is supported. You can find examples from the atest/swagger directory with corresponding tests for JSON and Yaml.

asimell avatar Dec 07 '21 10:12 asimell

Hello. Is there any update on the development of this? for OpenAPI v3.0. @asimell

Thank you.

dtook-nbs avatar Feb 01 '23 11:02 dtook-nbs

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Mar 04 '23 01:03 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Mar 19 '23 02:03 github-actions[bot]