You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2020/08/11 22:07:01 UTC

[GitHub] [openwhisk-wskdeploy] robertoyoc opened a new issue #1103: Support for Swagger 3.x

robertoyoc opened a new issue #1103:
URL: https://github.com/apache/openwhisk-wskdeploy/issues/1103


   # Subject of the issue
   Does wskdeploy support using Swagger 3.x file?
   Is OpenWhisk compatible with this OAS? 
   
   Your environment
   Local computer where trying to deploy:
   OpenWhisk CLI 1.0.0
   wskdeploy 1.0.0
   go version go1.14.7 linux/amd64
   
   Host:
   Ubuntu 18.04.4 LTS (GNU/Linux 5.3.0-1032-aws x86_64)
   Kubernetes Version 1.18.6
   Helm version v3.2.4
   
   Steps to reproduce
   I'm using the following OAS:
   
   open_api3_spec.yaml
   ```
   openapi: '3.0.0'
   info:
     version: '1.0'
     title: Hello World API
   servers:
     - url: 'https://<my_ip>/api'
       description: Development server
   
   paths:
     /hello/world:
       get:
         summary: Returns greeting
         description: Returns a greeting to the user!
         parameters:
           - in: query
             name: name
             description: The name of the user
             schema:
               type: string
           - in: query
             name: place
             description: The place where the user is at
             schema:
               type: string
         responses:
           '200':
             description: Returns the greeting.
             content:
               application/json:
                 schema:
                   $ref: '#/components/schemas/GreetingResponse'          
         operationId: getHello
         x-openwhisk:
           namespace: itio
           action: hello_world
           package: devops
           url: 'https://<my_ip>/api/v1/web/itio/devops/hello_world.json'
   
   components:
     schemas:
       GreetingResponse:
         type: object
         properties:
           greeting:
             type: string
             description: Greeting response
   
   x-ibm-configuration:
     assembly:
       execute:
         - operation-switch:
             title: whisk-invoke
             case:
               - operations:
                   - getHello
                 execute:
                   - invoke:
                       target-url: 'https://<my_ip>/api/v1/web/itio/devops/hello_world.json'
                       verb: keep
             otherwise: []
   
   ```
   
   manifest.json
   ```
   project:
     config: 'open_api3_spec.yaml'
     packages:
       devops:
         version: 1.0
         license: Apache-2.0
         actions:
           hello_world:
             function: src/hello.js
             annotations:
               web-export: true
   ```
   Then executing wskdeploy with these files.
   
   Expected behaviour
   API to be created with the OAS.
   
   Actual behaviour
   ```
   Error: manifestreader.go [118]: [ERROR_YAML_FILE_FORMAT_ERROR]: File: [manifest.yaml]:
   ==> Unable to parse swagger file: {{.err}}
   ```
   
   Also tried exporting a Swagger 3.0 file from Swagger Hub:
   swagger-export.yaml
   ```
   openapi: 3.0.0
   info:
     title: OpenAPIv3
     version: '1.0'
   servers:
     - url: 'http://<my_ip>/api'
   paths:
     /users:
       get:
         summary: Get Users
         tags: []
         responses:
           '200':
             description: OK
             content:
               application/json:
                 schema:
                   type: array
                   items:
                     $ref: '#/components/schemas/User'
         operationId: get-users
   components:
     schemas:
       User:
         title: User
         type: object
         properties:
           id:
             type: string
           name:
             type: string
   
   ```
   
   Error changed to:
   ```
   error: Unable to parse swagger file: Swagger file is invalid (missing basePath, info, paths, or swagger fields)
   ```
   From the error message, it says missing basePath, but this requirement is obsolete in OpenAPI 3.0.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [openwhisk-wskdeploy] rabbah commented on issue #1103: Support for Swagger 3.x

Posted by GitBox <gi...@apache.org>.
rabbah commented on issue #1103:
URL: https://github.com/apache/openwhisk-wskdeploy/issues/1103#issuecomment-673073211


   My guess is there are a few schema alignments necessary both in the cli/go client and in the route management package in the openwhisk repo. 
   
   Are you interested in submitting a pull request to support openapi?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org