-
Notifications
You must be signed in to change notification settings - Fork 187
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
Refactor scripts/generate-api-4.0-info/generate-api-4.0-info.js
to use OpenAPI spec
#5036
Comments
We should consider adding the data of fields supported by Related issue: #5370 |
ResearchThe current script generates API data for using a live instance of Wazuh manager:
I am reviewing the API spec file in The ApproachRegarding a previous investigation to get other data (#5370 (comment)) from the Wazuh API specification, we saw that using the I will create a new CLI, based on the POC script of #5370 (comment) |
Changes
|
ProblemWhile I was reviewing the differences in the output files of previous and new scripts, I realized the previous output doesn't include data of the body parameters and I think that is used by the I am researching if the body parameter suggestions feature is currently in the |
BackportsI am creating the backport for node@kibana:~/kbn/plugins/wazuh$ yarn add swagger-client
yarn add v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">= 12.20". Got "10.23.1"
error Found incompatible module I was researching a previous version compatible with NodeJS 10.23.1 and I found I added this version:
Then, I run the script and this seems to be working without problems: node@kibana:~/kbn/plugins/wazuh$ yarn generate:api-data
yarn run v1.22.5
$ node scripts/generate-api-data.js --spec https://raw.githubusercontent.com/wazuh/wazuh/$(node -e "console.log(require('./package.json').version.split('.').splice(0,2).join('.'))")/api/api/spec/spec.yaml --output file --output-directory common/api-info --display-configuration
{ displayConfiguration: true,
displayExamples: false,
displayHelp: false,
format: 'plugin',
output: 'file',
spec:
'https://raw.githubusercontent.com/wazuh/wazuh/4.5/api/api/spec/spec.yaml',
outputDirectory: '/home/node/kbn/plugins/wazuh/common/api-info' }
File was created! Path: /home/node/kbn/plugins/wazuh/common/api-info/security-actions.json
File was created! Path: /home/node/kbn/plugins/wazuh/common/api-info/endpoints.json
Done in 1.60s. |
Describe the solution you'd like
We want to simplify this process by using the OpenAPI spec of the wazuh manager obtained from the repository, instead of a live instance.
This process should be executed on each package generation, ensuring the appropriate information is included.
The text was updated successfully, but these errors were encountered: