Skip to content

Commit

Permalink
feat: Update from Netbox 3.0 swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel authored and Samuel Mutel committed Mar 10, 2022
1 parent c801fab commit 7744a95
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 18 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ jobs:
fail-fast: false
steps:
- name: Checkout
uses: actions/[email protected]

- name: Unshallow
run: git fetch --prune --unshallow
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Lint
uses: reviewdog/[email protected].2
uses: reviewdog/[email protected].3
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--config=.golangci.yml"
Expand All @@ -40,7 +39,7 @@ jobs:
shell: bash

- name: Commit library
uses: EndBug/add-and-commit@v7.4.0
uses: EndBug/add-and-commit@v7.5.0
with:
add: 'netbox swagger'
author_name: smutel
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
steps:
- name: Check conventional commits in PR
uses: Namchee/conventional-pr@v0.6.0
uses: Namchee/conventional-pr@v0.8.0
with:
access_token: ${{ secrets.github_token }}
label: "no-conventional-commits"
Expand All @@ -20,10 +20,9 @@ jobs:
strict: false

- name: Checkout
uses: actions/[email protected]

- name: Unshallow
run: git fetch --prune --unshallow
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Setup env
run: |
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ jobs:
fail-fast: false
steps:
- name: Checkout
uses: actions/[email protected]

- name: Unshallow
run: git fetch --prune --unshallow
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Get tag
id: tag
Expand Down
13 changes: 13 additions & 0 deletions patchs/swagger-v3.0.11-ipaddress-assignedobject.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- swagger-v3.0.11.json.ori 2022-03-10 12:53:02.603023681 +0100
+++ swagger-v3.0.11.json 2022-03-10 12:54:21.124172300 +0100
@@ -3761,10 +3761,6 @@
"type" : "string"
},
"assigned_object" : {
- "additionalProperties" : {
- "type" : "string",
- "x-nullable" : true
- },
"readOnly" : true,
"title" : "Assigned object",
"type" : "object"
10 changes: 10 additions & 0 deletions patchs/swagger-v3.0.11-vlangroup-maxint.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- swagger-v3.0.11.json.ori 2022-03-10 06:28:02.676236888 +0100
+++ swagger-v3.0.11.json 2022-03-10 06:31:17.782874886 +0100
@@ -10027,7 +10027,6 @@
"type" : "string"
},
"scope_id" : {
- "maximum" : 9223372036854775807,
"minimum" : 0,
"title" : "Scope id",
"type" : "integer",
4 changes: 2 additions & 2 deletions utils/netbox_generate_client
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export VERSION=${LAST_NETBOX_VERSION}
git clone https://github.com/netbox-community/netbox-docker.git -q
cd netbox-docker
git config advice.detachedHead false
git checkout 1.2.0
git checkout 1.4.1
mv docker-compose.override.yml.example docker-compose.override.yml
docker-compose up -d --quiet-pull
cd ..
Expand All @@ -70,7 +70,7 @@ echo "Check swagger definition ..."
jsonlint "$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel/go-netbox/netbox/swagger-${VERSION}.json"

echo "Get go-swagger and generate lib ..."
curl -sL https://github.com/go-swagger/go-swagger/releases/download/v0.28.0/swagger_linux_amd64 -o swagger
curl -sL https://github.com/go-swagger/go-swagger/releases/download/v0.29.0/swagger_linux_amd64 -o swagger
chmod 755 swagger
./swagger generate client -f "$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel/go-netbox/netbox/swagger-${VERSION}.json" -t "$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel/go-netbox/netbox" --copyright-file="$(dirname $GITHUB_WORKSPACE)/src/github.com/smutel/go-netbox/LICENSE"

Expand Down
2 changes: 1 addition & 1 deletion utils/netbox_major_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.11
v3.0

0 comments on commit 7744a95

Please sign in to comment.