-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Request] Add customization of OpenAPI exports #451
Comments
We adjusted the OpenAPI generation with additional configuration, see #565. |
Thank you Chris. Just to confirm about this customization is now available (visible in AME 5.5 and above), but as per our last chat, Has this been addressed? |
Hi @Kostadin-Ivanov,
|
Hello @atextor , I presume that these are yet to be released in next release for Aspect Model Editor. Thank you for your support again. |
Is your task related to a problem? Please describe.
Could we have a functionality which can be used to customize the exported OpenAPI?
Currently the generated OpenAPIs are pretty focused on a digital twin system (DTS) and are provided mainly with GET and POST (when 'IncludeQueryApi' is checked) operations.
I am not sure what is the other option: 'UseSemanticVersion' for, because I could not find any difference in exported OpenAPI model with or without it.
In general currently generated OpenAPIs - with and without 'IncludeQueryApi' have paths like: GET: /{tenant-id}/my-api-model and POST: /{tenant-id}/my-api-model, where each path has, currently it seems to be hardcoded URL parameter: tenant-id, and the POST operation has request body like:
{ "filter": "filter={filter expression}", "option": "option=limit({start},{count})" }
which, I guess is still quite DTS related and, here I am just guessing, provides for some sort of retrieving of specific elements of my-api-model, which I can specify in the filter.
Further, the currently generated OpenAPI provides the following responses: 200 - OK, 401 - ClientError, 402 - Unauthorized, 403 - Forbidden and 404 - NotFound with some predefined response bodies, which also seem to be DTS focused.
Describe the solution you'd like
Would it be possible to:
For example: if my-api-model is for object like:
{ element1: "e1 value", element2: "e2 value", element3: {...} }
The generated paths would be, lets take just a GET request:
/my-api-model
- to retrieve list with all available models
/my-api-model/{id}
- to retrieve particular object with specified id
/my-api-model/{id}/element1
- to get element1 from object with specified id
/my-api-model/{id}/element3
- to get the whole element3 for specified object id and so on and so forth.
For example: the only responses required might be 200 - OK and 404 - NotFound. Further in case of creation, maybe new response: 201 - Created could be added etc.
Describe alternatives you've considered
With current implementation of OpenAPI exports, if I want to achieve above OpenAPI adjustments, I have to take generated OpenAPI for myApiModel and then manually do these updates.
With regards to implementation, I am not sure, but either: having option to specify a template which then can be "imported" or having some kind of parameters for above customization might be one way to be implemented in the SDK.
With regards to AME - UI, probably some check options / buttons or functionality to "import" templates might be one way to achieve this.
Additional context
Currently not available, but if required I can provide some.
The text was updated successfully, but these errors were encountered: