OAGi / Score

Score
MIT License
9 stars 6 forks source link

Update BIE root view to include Open API options #1519

Open dubnemo opened 1 year ago

dubnemo commented 1 year ago

Currently I have been using Remark to capture Open API information since it display nice on the BIE list view.

Perhaps this is the appropriate UI to capture the following, as there seems to be enough real estate on the screen, and these parameters are directly related 1:1 to the BIE:

Replace Remark with real OpenAPI fields 2023-07-02-091232_1920x1080_scrot

Here is how I historically have used Remark to have a logical list of related BIEs. The new issue #1492 is similar type of view: 2023-07-02-091825_1920x1080_scrot

dubnemo commented 1 year ago

@bingqi2045 @hakjuoh I think this is the way to go. Define these parameters on the BIE root itself, and which would help the merge into the single yml

bingqi2045 commented 1 year ago

@dubnemo @hakjuoh

Screenshot 2023-07-05 at 9 34 50 AM

In this example, two different verbs are assigned to the same BIE, so it is not possible to directly related 1:1 to BIE.

hakjuoh commented 1 year ago

@bingqi2045 The OpenAPI information will appear if the BIE has a relationship with the OpenAPI document as below.

Screenshot 2023-07-14 at 11 10 49 AM
dubnemo commented 1 year ago

@hakjuoh @bingqi2045 yes, that is exactly what I was envisioning. Maybe between the context definition and component definition.

Are these editable? If you choose Response Body, is it stored the corresponding table for response? Or are the tables (response, request, parameters) now collapsed into one table?

You asked in #1492 if there was a chance if the BIE could be reused across multiple operations, which in this case this information could repeat. Would that be possible? It would be scrollable. These are the scenarios, specifically when the identifiers for the core and child objects are available after creating in the DB after POST:

VERB Part Comment
POST responseBody After generation of ids in a DB, the complete object is returned back. This responseBody is a copy of the requestBody with the appropriate generated Ids enabled.
GET responseBody Returns the current object with identifiers, as persisted in the DB.
PATCH responseBody After update of the object, the current object with identifers is returned.
PATCH requestBody Seldom used, but if so, this is a user-defined component that assembles BCCPs that can be updated. If there are only a few these are most often query parameters.
PUT requestBody Provides the ability to replace the complete business object. These is seldom used today, so lower priority.
PUT responseBody After replacement of the object, the current object with identifers is returned.

Each reused BIE would be a row in the request, response or parameter table, a UNION of these core attributes would be displayed:

dubnemo commented 1 year ago

Note the relationship to a single OpenAPI doc, and the ability to add a BIE relationship to the doc.

MultipleBIEs_mapping_operationId

We should also review the logic to generated the OperationId. I am showing the reference type, and the verb mapping we did for securitySchema reference with create, etc. prefixed to the BIE name.

<operation_id>::= <referenceType>_<crudVerb><BIEName>
<referenceType> ::= 'response' | 'requestBody' | 'parameters'
bingqi2045 commented 1 year ago

@dubnemo @hakjuoh Regarding the question: Are these editable? If you choose Response Body, is it stored the corresponding table for response? Or are the tables (response, request, parameters) now collapsed into one table?

Yes, They are editable. the response, request and parameters tables are separate and stored in the corresponding table in the database.