Giter Site home page Giter Site logo

abap-swagger's People

Contributors

binaeg avatar blackmancc avatar johanneskonings avatar jrodriguez-rc avatar larshp avatar npmcdn-to-unpkg-bot avatar nununo avatar pokrakam avatar xinitrc86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

abap-swagger's Issues

Installing Issues - Objects not created

I need this repo primarily to use abapgitserver.

I have issues when trying to clone the Swagger Repo via AbapGit.
The objects are not created in the system.

image

The download completes without a problem, also there are no exceptions thrown in the debugger.

image

Other repos, like ABAP2XLSX, were successfully installed in our system.

Is there any setting or naming convention to follow?

Following solutions were tested:

  • Naming the package with a Z ("ZABAPSWAGGER")
  • Creating a local package ("$ABAPSWAGGER")
  • Creating the package in Namespace
  • Cloning the repo when logged in in English language

How to leverage this with Gateway service developed using SEGW

Hello Team,
I am very delightful to know about this open source project and it is quite useful for ABAPers who are working on SAP REST services as a provider to outside world. Thanks and much appreciated.
However, I am wondering is there any way to leverage to REST services developed using SEGW transaction in SAP to run and test the service directly through Swaggger UI by IIB/.Net (non-SAP) developers in order to create client interface out of it.
I would appreciate if someone point me to the discussion if it was already closed to verify once.
Thanks, Naresh

Request for "latest" tag

Hi @larshp ,

I would like to suggest you to create a "latest" tag.
By doing this, it's easier to get the repository in zip file instead of cloning the project on the computer, then making a ZIP file to import the project on another SAP which has no access to GitHub.

image

Thanks a lot for Library.

Kindly regards,
Nicolas D. @neooblaster

Using Local Class Variables in Web Service Methods

Hi @larshp,
I am unable to use Local Class Variables in my class due to RETURNING Parameters restriction. With RETURNING addition, only Data Dictionary Types can be declared.

When i changed it to allow EXPORTING Parameters, it allowed me to use local class variables.
Now, the problem is, the local types are not interpreted correctly in the BUILD_PARAMETERS method.
For example, i have a method that takes KUNNR as input and TT_OUTPUT as output.
So, it gives a DUMP because BUILD_PARAMETERS reads TT_OUTPUT as string, whereas my method is expecting a table type.

To make it work, i had to convert it to JSON string and pass it as output.
Any advice will be appreciated

DATA: in definitions/model

The current implementation builds definitions/models as following:

definitions: {
    TY_STRUCTURE: {
          type: "object",
          properties: {
              DATA: {
                  type: "object",
                  properties: {
                      FOO: {
                           type: "string"
                      },
                      BAR: {
                           type: "string"
                      }
                  }
             }
          }
    }
}

There ist always a bracket with "DATA:", then "type: "object""

When I look at the swagger specification
https://swagger.io/specification/v2/

and the swagger petstore sample, i cannot find any DATA bracket.

Would it be better it it was like this?

definitions: {
    TY_STRUCTURE: {
          type: "object",
          properties: {
                      FOO: {
                           type: "string"
                      },
                      BAR: {
                           type: "string"
                      }
                  }
             }
          }
    }
}

What do you think?

Using ABAP-Swagger with CL_REST_HTTP_HANDLER

Hi there,

I stumbled over this awesome repo while I was searching for a better way to put some more info to my recent REST-Service. Unfortunately I'm struggling a little bit to get things to work.

I use the CL_REST_HTTP_HANDLER class and created multiple handler classes which are attached to a CL_REST_ROUTER via certain paths and that's where my problem starts. I question myself - Is there a way to generate a spec for multiple paths/classes at once? (considering the use CL_REST_HTTP_HANDLER and CL_REST_ROUTER )

Best regards,

Michael

Authorization

Hi there!

I tried to assign a technical User in SICF to enable external Users to see the Page and authorize via the button if they want to test, but in Debugging I always see the technical User in sy-uname. So if the User needs to Log On with his SAP User to reach the Page, the Authorize Button is not really needed. Is there a way to remove the button?

regards,
Alex

duplicated mapping key

I am trying to register different handler classes for one url path.
The reason is that I want to implement different versions of same class in one swagger ui
and include version (v2, v3) in path.
If the different classes have methods with the same name I get a "duplicated mapping key".

Do you have any idea? What can I do?

Spec HyperLink Not Working Anymore

Hi Lars,
The spec hyperlink is not working anymore.

image

It is directing to about:blank

Attached is my spec doc

swagger: '2.0'
host: 'sdev4.sapr3.ad.davey-tree.com:8400'
info:
  version: 1.0.0
  title: Davey Web Services
  description: Davey Web Services REST functions
basePath: /sap/bc/zvci_repository
tags:
  - name: ZVCI Web Services
    description: Everything about ZVCI Web Services
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
paths:
  /swag/get_tickt_details:
    get:
      tags:
        - ZVCI Web Services
      summary: Get Ticket Details
      description: ''
      parameters:
        - name: TICKETNO
          in: query
          description: ''
          type: string
          required: true
      produces:
        - application/json
      responses:
        '200':
          description: successful operation
        '500':
          description: error
  /swag/get_customer_texts:
    get:
      tags:
        - ZVCI Web Services
      summary: Get Customer Texts
      description: ''
      parameters:
        - name: IV_KUNNR
          in: query
          description: ''
          type: string
          required: true
      produces:
        - application/json
      responses:
        '200':
          description: successful operation
        '500':
          description: error
definitions: {}

catching all exceptions of handler method

In the current implementation exceptions of the handler method have to be of type zcx_swag.
The only limitiation for using methods as handler methods is that they should ony have one returning parameter.

I think it would be better to catch cx_root so that we also can use handler methods throwing non zx_swag exceptions.

`

    TRY.
        CALL METHOD <ls_meta>-obj->(<ls_meta>-meta-handler)

          PARAMETER-TABLE lt_parameters.
      CATCH zcx_swag INTO lx_swag.
        mi_server->response->set_cdata( |{ lx_swag->status_code }, { lx_swag->get_text( ) }| ).
        mi_server->response->set_status( code = lx_swag->status_code reason = lx_swag->get_text( ) ).
        RETURN.
    ENDTRY.

`

@larshp What do you think?

Missing bracket } while using multiple tag descriptions with externalDoc

While using 2 tag descripotions with externalDoc for the first one there is a closing bracket missing
at the end of the second description (before ] bracket)

"name":"contacts_controller",
"description":"Kontakte"
,
"externalDocs": { "description":"Blackmans Page",
"url":"http://blackmancc.io" }
}
,
{
"name":"test",
"description":"Test"
],

Failing tests

Hi larshp,
I saw some tests are failling (7.51)
"test" test method on zcl_swag
"char" method on swag_map_type

Overall the coverage is not that good too...

How to make it work

Hi Lars,
I am unable to decide the list of classes that i have to implement and in which flow to make it work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.