Skip to content

Commit

Permalink
chore: Extended OpenAPIAnnotation (#40)
Browse files Browse the repository at this point in the history
Refs: #39
  • Loading branch information
pbezliapovich authored Oct 9, 2024
1 parent 99e188e commit 7f04a73
Show file tree
Hide file tree
Showing 10 changed files with 686 additions and 61 deletions.
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ repos:
- id: check-yaml
- id: no-commit-to-branch
- id: mixed-line-ending
- id: pretty-format-json
args: [ --autofix, --no-ensure-ascii, '--top-keys=openapi,info,servers,paths,components' ]
files: docs/openapi.json
- repo: https://github.com/zricethezav/gitleaks
rev: v8.20.1
hooks:
Expand Down
56 changes: 1 addition & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,61 +32,7 @@ Changes only take effect after restart of Polarion.

### REST API

Get version:
```bash
curl --location 'https://<HOST>:<PORT>/polarion/api-extender/rest/api/version' \
--header 'Authorization: Bearer <TOKEN_GOES_HERE>'
```
Response example:
```json
{
"bundleName":"API Extension for Polarion ALM",
"bundleVendor":"SBB AG",
"automaticModuleName":"ch.sbb.polarion.extension.api_extender",
"bundleVersion":"1.0.0",
"bundleBuildTimestamp":"2023-06-27 12:43",
"bundleBuildTimestampDigitsOnly":"202306271243"
}
```

Get custom field value:
```bash
curl --location 'https://<HOST>:<PORT>/polarion/api-extender/rest/api/projects/<PROJECT_ID>/keys/<CUSTOM_FIELD>' \
--header 'Authorization: Bearer <TOKEN_GOES_HERE>'
```

Get global record value:
```bash
curl --location 'https://<HOST>:<PORT>/polarion/api-extender/rest/api/records/<RECORD>' \
--header 'Authorization: Bearer <TOKEN_GOES_HERE>'
```

Response example:
```json
{
"value": "custom_value"
}
```

Set custom field value:
```bash
curl --location 'https://<HOST>:<PORT>/polarion/api-extender/rest/api/projects/<PROJECT_ID>/keys/<CUSTOM_FIELD>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <TOKEN_GOES_HERE>' \
--data '{
"value": "<VALUE>"
}'
```

Set global record value:
```bash
curl --location 'https://<HOST>:<PORT>/polarion/api-extender/rest/api/records/<RECORD>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <TOKEN_GOES_HERE>' \
--data '{
"value": "<VALUE>"
}'
```
This extension provides REST API. OpenAPI Specification can be obtained [here](docs/openapi.json).

### Live Report Page

Expand Down
Loading

0 comments on commit 7f04a73

Please sign in to comment.