From 888254651a55451de78cf7c91a1625f99460e831 Mon Sep 17 00:00:00 2001 From: smutel <12967891+smutel@users.noreply.github.com> Date: Sun, 15 May 2022 17:59:39 +0200 Subject: [PATCH] feat: Update from Netbox 3.1 swagger --- .github/workflows/pr.yml | 2 - README.md | 2 + ...r-v3.1.11-device-vm-localcontextdata.patch | 91 +++++++++++++++++++ ...ger-v3.1.11-ipaddress-assignedobject.patch | 13 +++ utils/netbox_generate_client | 2 +- utils/netbox_major_version | 2 +- 6 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 patchs/swagger-v3.1.11-device-vm-localcontextdata.patch create mode 100644 patchs/swagger-v3.1.11-ipaddress-assignedobject.patch diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 82cab121..ac705725 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -14,9 +14,7 @@ jobs: uses: Namchee/conventional-pr@v0.10.1 with: access_token: ${{ secrets.github_token }} - label: "no-conventional-commits" close: false - template: "Thank you for your contribution attempt in this repository!\n\nUnfortunately, this pull request doesn't meet our standards by reason we stated below.\nFor future pull requests, please use conventional commits.\nPlease update the commits in this PR with conventional commits rules." strict: false report: false diff --git a/README.md b/README.md index e3daecfe..d10dd5d4 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,8 @@ func main() { ### Installing the go-netbox ```sh +$ # Install jsonlint +$ apt-get install python3-demjson $ mkdir -p ~/go/src/github.com/smutel $ cd ~/go/src/github.com/smutel $ git clone git@github.com:smutel/go-netbox.git diff --git a/patchs/swagger-v3.1.11-device-vm-localcontextdata.patch b/patchs/swagger-v3.1.11-device-vm-localcontextdata.patch new file mode 100644 index 00000000..ce702206 --- /dev/null +++ b/patchs/swagger-v3.1.11-device-vm-localcontextdata.patch @@ -0,0 +1,91 @@ +--- swagger-v3.1.11.json.ori 2022-05-16 14:48:51.588387301 +0200 ++++ swagger-v3.1.11.json 2022-05-16 14:53:12.116003672 +0200 +@@ -2369,7 +2369,7 @@ + }, + "local_context_data" : { + "title" : "Local context data", +- "type" : "string", ++ "type" : "object", + "x-nullable" : true + }, + "location" : { "$ref" : "#/definitions/NestedLocation" }, +@@ -2888,10 +2888,6 @@ + "type" : "string" + }, + "config_context" : { +- "additionalProperties" : { +- "type" : "string", +- "x-nullable" : true +- }, + "readOnly" : true, + "title" : "Config context", + "type" : "object" +@@ -2951,7 +2947,7 @@ + }, + "local_context_data" : { + "title" : "Local context data", +- "type" : "string", ++ "type" : "object", + "x-nullable" : true + }, + "location" : { "$ref" : "#/definitions/NestedLocation" }, +@@ -11401,10 +11397,6 @@ + "type" : "string" + }, + "config_context" : { +- "additionalProperties" : { +- "type" : "string", +- "x-nullable" : true +- }, + "readOnly" : true, + "title" : "Config context", + "type" : "object" +@@ -11445,7 +11437,7 @@ + }, + "local_context_data" : { + "title" : "Local context data", +- "type" : "string", ++ "type" : "object", + "x-nullable" : true + }, + "memory" : { +@@ -14251,10 +14243,6 @@ + "type" : "string" + }, + "config_context" : { +- "additionalProperties" : { +- "type" : "string", +- "x-nullable" : true +- }, + "readOnly" : true, + "title" : "Config context", + "type" : "object" +@@ -14304,7 +14292,7 @@ + }, + "local_context_data" : { + "title" : "Local context data", +- "type" : "string", ++ "type" : "object", + "x-nullable" : true + }, + "location" : { +@@ -18739,10 +18727,6 @@ + "type" : "string" + }, + "config_context" : { +- "additionalProperties" : { +- "type" : "string", +- "x-nullable" : true +- }, + "readOnly" : true, + "title" : "Config context", + "type" : "object" +@@ -18783,7 +18767,7 @@ + }, + "local_context_data" : { + "title" : "Local context data", +- "type" : "string", ++ "type" : "object", + "x-nullable" : true + }, + "memory" : { diff --git a/patchs/swagger-v3.1.11-ipaddress-assignedobject.patch b/patchs/swagger-v3.1.11-ipaddress-assignedobject.patch new file mode 100644 index 00000000..1ab787d0 --- /dev/null +++ b/patchs/swagger-v3.1.11-ipaddress-assignedobject.patch @@ -0,0 +1,13 @@ +--- swagger-v3.1.11.json.ori 2022-05-16 14:48:51.588387301 +0200 ++++ swagger-v3.1.11.json 2022-05-16 15:04:26.365989795 +0200 +@@ -4986,10 +4986,6 @@ + "type" : "string" + }, + "assigned_object" : { +- "additionalProperties" : { +- "type" : "string", +- "x-nullable" : true +- }, + "readOnly" : true, + "title" : "Assigned object", + "type" : "object" diff --git a/utils/netbox_generate_client b/utils/netbox_generate_client index dea42ba5..7dfe067a 100755 --- a/utils/netbox_generate_client +++ b/utils/netbox_generate_client @@ -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.4.1 +git checkout 1.6.0 mv docker-compose.override.yml.example docker-compose.override.yml docker-compose up -d --quiet-pull cd .. diff --git a/utils/netbox_major_version b/utils/netbox_major_version index d9fb9c73..86166894 100644 --- a/utils/netbox_major_version +++ b/utils/netbox_major_version @@ -1 +1 @@ -v3.0 +v3.1