buerokratt / Service-Module

0 stars 11 forks source link

Automatically generating REST endpoint's key fields #9

Open SigritSiht opened 2 years ago

SigritSiht commented 2 years ago

AS an Administrative User I WANT TO get entered API / X-Road request body as pre-filled text fields SO THAT I CAN have the correct values provided to me automatically

Acceptance Criteria

DSL

GUI

Should be part of other issues, for example by Service Module Connection Page

turnerrainer commented 2 years ago

@SigritSiht please specify both the user story and AC.

Pre-filled part is a bit confusing - pre-filled with

  1. ~some actual sample data; or~
  2. extract the structure of the X-road service based on their WSDL showing that this particular service requires personal code to be filled as a mandatory field and an email, first name, and last name as optional ones?
turnerrainer commented 2 years ago

A note for myself - based on WSDL and OpenAPI spec endpoints, appropriate fields should be generated by GUI.

1AhmedYasser commented 1 year ago

@turnerrainer So we would be using x-road and open-api WSDL to get the input parameters for any endpoint ? if so, how do you propose we do it, do we hit a wsdl url and then parse the result or are you thinking of a better approach ?

turnerrainer commented 1 year ago

@turnerrainer So we would be using x-road and open-api WSDL to get the input parameters for any endpoint ? if so, how do you propose we do it, do we hit a wsdl url and then parse the result or are you thinking of a better approach ?

@1AhmedYasser let's start with both one- and multi-level JSONs and cover WSDLs after that.

1AhmedYasser commented 1 year ago

@turnerrainer Got it, so i will be going with the following: Services that we will extract its input fields (required or optional) has to based on the OpenAPI specification

X-Road Reference: https://www.x-tee.ee/docs/live/xroad/pr-rest_x-road_message_protocol_for_rest.html X-Road PDF on Rest API: https://joinup.ec.europa.eu/sites/default/files/event/attachment/2020-10/2020-09-25-How_Petteri.pdf

For example:

  1. PetStore: https://petstore3.swagger.io/api/v3/openapi.json
  2. Resql Example: http://localhost:8082/v3/api-docs
  3. X-Road: https://koodivaramu.eesti.ee/x-tee/x-road-cs-api/-/blob/74d50b4e5f997e9cdaa22d687da77ff23c1ecc79/openapi-definition.yaml

So by using open api specification the flow could be done as follows:

Open API Spec Json --> Json Schema --> React UI

1AhmedYasser commented 1 year ago

@turnerrainer We need this feature https://github.com/buerokratt/Ruuter/pull/104 added to Ruuter in-order to pass dynamic url's to DSL's

SigritSiht commented 1 year ago

@1AhmedYasser Mikk will most likely need information about what user needs to provide for #12.

1AhmedYasser commented 1 year ago

@SigritSiht Ok So basically when a user wants to add an endpoint he will either choose: 1) To Enter a custom Endpoint 2) To Enter a server Open Api Spec

In this manner we will provide 2 Options for the user

1) To Enter a custom endpoint and add his own stuff (parameters, headers, type) (i.e. could be any endpoint in the world) 2) To Enter a server open api spec (Will help his automate and speed the process so that he wont have to enter each each endpoint individually)