asyrjasalo / RESTinstance

Robot Framework library for RESTful JSON APIs
https://asyrjasalo.github.io/RESTinstance
GNU Lesser General Public License v3.0
203 stars 84 forks source link

How to use OpenApiSpecification yaml #124

Closed ZephyrusMB closed 1 year ago

ZephyrusMB commented 2 years ago

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

asimell commented 2 years ago

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.

ZephyrusMB commented 2 years ago

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.

asimell commented 2 years ago

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

dtook-nbs commented 1 year ago

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

Thank you.

github-actions[bot] commented 1 year ago

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

github-actions[bot] commented 1 year ago

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