Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two different parameters, referencing same data type, have different definition #76

Open
erichopp opened this issue Jul 19, 2021 · 2 comments

Comments

@erichopp
Copy link

This is exposed by https://github.com/larshp/todo_logic

From this ABAP source:
CLASS zcl_todo DEFINITION PUBLIC CREATE PUBLIC.

PUBLIC SECTION.
METHODS create
IMPORTING
!is_data TYPE ztodo_data
RETURNING
VALUE(rs_key) TYPE ztodo_key .
METHODS delete
IMPORTING
!is_key TYPE ztodo_key .
METHODS list
RETURNING
VALUE(rt_list) TYPE ztodo_tt .
METHODS update
IMPORTING
!iv_guid TYPE ztodo_key-guid
!is_data TYPE ztodo_data .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.

The definitions section ends up with a duplicate key, ZTODO_KEY being defined two different ways:
"definitions":{
"ZTODO_DATA": {"type":"object", "properties":{"TEXT":{"type":"string" }}},
"ZTODO_KEY": {"type":"object", "properties":{"GUID":{"type":"string", "maxLength": 22 }}},
"ZTODO_KEY":{"type": "object","properties": {"DATA": {"type":"object", "properties":{"GUID":{"type":"string", "maxLength": 22 }}}}},
"ZTODO_TT":{"type": "object","properties": {"DATA": {"type":"array", "items":{"type":"object", "properties":{"MANDT":{"type":"string", "maxLength": 3 },"GUID":{"type":"string", "maxLength": 22 },"TEXT":{"type":"string" }}}}}}
}

@larshp
Copy link
Owner

larshp commented Jul 20, 2021

thanks, pull requests welcome

however, I'm planning to move everything to https://github.com/abap-openapi, and rewrite this sometime, so it can be tested using https://github.com/open-abap

@GianlucaCollot
Copy link

The problem lies in ZCL_SWAG_SPEC=>RESPONSE() that buids the definition for returning parameters differently than what does REQUEST.
Here is my fix:
immagine

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

No branches or pull requests

3 participants