Add workflow for api gen and refactor genration script (#60)

* update gitignore

* add first version of api generation flow

* try to run flow

* testing flow

* update gen flow

* switch flow to macOS

* fix

* add npm install

* test workflow

* Update API pages

* test workflow with current main

* refactor parser

* merge examples and schema functions

* merge examples and schema functions

* merge parameters as well

* revert template to single class component

* update account

* finalizing

* update with the newest version of openapi

* full flow

* update

* add docker command

* split flow in two jobs

* remove testing trigger

---------

Co-authored-by: GitHub Actions <no-reply@github.com>
This commit is contained in:
pascal-fischer
2023-06-05 09:35:54 +02:00
committed by GitHub
parent 33b3153723
commit f33b4df3dd
20 changed files with 481 additions and 5928 deletions

View File

@@ -1,4 +1,3 @@
export const title = 'Groups'
@@ -7,7 +6,7 @@ export const title = 'Groups'
<Row>
<Col>
Returns a list of all Groups
Returns a list of all groups
</Col>
<Col sticky>
@@ -207,7 +206,7 @@ echo $response;
<Row>
<Col>
Creates a Group
Creates a group
#### Request-Body Parameters
<Properties>
@@ -238,7 +237,7 @@ curl -X POST https://api.netbird.io/api/groups \
--data-raw '{
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
}'
```
@@ -248,7 +247,7 @@ const axios = require('axios');
let data = JSON.stringify({
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
});
let config = {
@@ -280,7 +279,7 @@ url = "https://api.netbird.io/api/groups"
payload = json.dumps({
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
})
headers: {
@@ -312,7 +311,7 @@ func main() {
payload := strings.NewReader(`{
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
}`)
client := &http.Client {
@@ -362,7 +361,7 @@ request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
})
response = https.request(request)
@@ -376,7 +375,7 @@ MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
}');
Request request = new Request.Builder()
@@ -406,7 +405,7 @@ curl_setopt_array($curl, array(
CURLOPT_POSTFIELDS => '{
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
}',
CURLOPT_HTTPHEADER => array(
@@ -469,7 +468,7 @@ echo $response;
<Row>
<Col>
Get information about a Group
Get information about a group
#### Path Parameters
<Properties>
@@ -673,7 +672,7 @@ echo $response;
<Row>
<Col>
Update/Replace a Group
Update/Replace a group
#### Path Parameters
<Properties>
@@ -712,7 +711,7 @@ curl -X PUT https://api.netbird.io/api/groups/{groupId} \
--data-raw '{
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
}'
```
@@ -722,7 +721,7 @@ const axios = require('axios');
let data = JSON.stringify({
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
});
let config = {
@@ -754,7 +753,7 @@ url = "https://api.netbird.io/api/groups/{groupId}"
payload = json.dumps({
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
})
headers: {
@@ -786,7 +785,7 @@ func main() {
payload := strings.NewReader(`{
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
}`)
client := &http.Client {
@@ -836,7 +835,7 @@ request["Authorization"] = "Token <TOKEN>"
request.body = JSON.dump({
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
})
response = https.request(request)
@@ -850,7 +849,7 @@ MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, '{
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
}');
Request request = new Request.Builder()
@@ -880,7 +879,7 @@ curl_setopt_array($curl, array(
CURLOPT_POSTFIELDS => '{
"name": "devs",
"peers": [
null
"ch8i4ug6lnn4g9hqv7m1"
]
}',
CURLOPT_HTTPHEADER => array(
@@ -943,7 +942,7 @@ echo $response;
<Row>
<Col>
Delete a Group
Delete a group
#### Path Parameters
<Properties>