Title: Issue creating objectstorage access key without an expiry · Issue #809 · stackitcloud/stackit-sdk-python · GitHub
Open Graph Title: Issue creating objectstorage access key without an expiry · Issue #809 · stackitcloud/stackit-sdk-python
X Title: Issue creating objectstorage access key without an expiry · Issue #809 · stackitcloud/stackit-sdk-python
Description: Hello, I want to create a access key without an expiry. But I keep running into an pydantic problem. I am running this code: config = Configuration() client = DefaultApi(config) name = "abc" project_id = os.getenv("OS_PROJECT_NAME") cred...
Open Graph Description: Hello, I want to create a access key without an expiry. But I keep running into an pydantic problem. I am running this code: config = Configuration() client = DefaultApi(config) name = "abc" projec...
X Description: Hello, I want to create a access key without an expiry. But I keep running into an pydantic problem. I am running this code: config = Configuration() client = DefaultApi(config) name = "abc&qu...
Opengraph URL: https://github.com/stackitcloud/stackit-sdk-python/issues/809
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Issue creating objectstorage access key without an expiry","articleBody":"Hello,\n\nI want to create a access key without an expiry. But I keep running into an pydantic problem.\n\nI am running this code:\n\n```python\n config = Configuration()\n client = DefaultApi(config)\n name = \"abc\"\n project_id = os.getenv(\"OS_PROJECT_NAME\")\n cred_grp_resp = client.create_credentials_group(\n project_id, \"eu01\", CreateCredentialsGroupPayload(displayName=name)\n )\n acc_key_resp = client.create_access_key(\n project_id,\n \"eu01\",\n CreateAccessKeyPayload(),\n cred_grp_resp.credentials_group.credentials_group_id,\n )\n```\n\nThe error I am getting is:\n\n```\n File \"/app/pylfc/s3.py\", line 196, in create_bucket_credentials\n acc_key_resp = client.create_access_key(\n File \"/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_validate_call.py\", line 39, in wrapper_function\n return wrapper(*args, **kwargs)\n File \"/usr/local/lib/python3.10/dist-packages/pydantic/_internal/_validate_call.py\", line 136, in __call__\n res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/api/default_api.py\", line 139, in create_access_key\n return self.api_client.response_deserialize(\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/api_client.py\", line 275, in response_deserialize\n return_data = self.deserialize(response_text, response_type, content_type)\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/api_client.py\", line 363, in deserialize\n return self.__deserialize(data, response_type)\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/api_client.py\", line 408, in __deserialize\n return self.__deserialize_model(data, klass)\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/api_client.py\", line 626, in __deserialize_model\n return klass.from_dict(data)\n File \"/usr/local/lib/python3.10/dist-packages/stackit/objectstorage/models/create_access_key_response.py\", line 87, in from_dict\n _obj = cls.model_validate(\n File \"/usr/local/lib/python3.10/dist-packages/pydantic/main.py\", line 693, in model_validate\n return cls.__pydantic_validator__.validate_python(\npydantic_core._pydantic_core.ValidationError: 1 validation error for CreateAccessKeyResponse\nexpires\n Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]\n For further information visit https://errors.pydantic.dev/2.11/v/string_type\n```\n\nI seems the \"CreateAccessKeyPayload\" accepts an \"None\" expiry date, which is allowed looing at the api docs, but the CreateAccessKeyResponse requires it the field to be a string and not None.\n\nUsing the same code but setting an \"expires\" allows me to create the key:\n\n```python\n acc_key_resp = client.create_access_key(\n project_id,\n \"eu01\",\n CreateAccessKeyPayload(expires=datetime(2026, 1, 1)),\n cred_grp_resp.credentials_group.credentials_group_id,\n )\n```\n\nAsking for a fix. Kind regards, Sebastian","author":{"url":"https://github.com/sebastianelsner","@type":"Person","name":"sebastianelsner"},"datePublished":"2025-03-28T17:56:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/809/stackit-sdk-python/issues/809"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5bc8d920-ee48-1ba1-471b-b6f86c2ae5c6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B29C:108B01:3CF39F0:517901C:6981B11C |
| html-safe-nonce | 27372e382e4797d2c5f524b39cf29efd989bbce2c25b914fc9b5482c30b4cb2a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjlDOjEwOEIwMTozQ0YzOUYwOjUxNzkwMUM6Njk4MUIxMUMiLCJ2aXNpdG9yX2lkIjoiNzk0NjYzOTgxMjQyMzk1NDcxNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ad3071cae75669a5f4c332a38dc3af4254427324499b31bfb1129b6b0da765c3 |
| hovercard-subject-tag | issue:2956821661 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/stackitcloud/stackit-sdk-python/809/issue_layout |
| twitter:image | https://opengraph.githubassets.com/09c9844c92c232a7e90846880a582e7baf6cb08921df25c1e14264ed9aee2f14/stackitcloud/stackit-sdk-python/issues/809 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/09c9844c92c232a7e90846880a582e7baf6cb08921df25c1e14264ed9aee2f14/stackitcloud/stackit-sdk-python/issues/809 |
| og:image:alt | Hello, I want to create a access key without an expiry. But I keep running into an pydantic problem. I am running this code: config = Configuration() client = DefaultApi(config) name = "abc" projec... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sebastianelsner |
| hostname | github.com |
| expected-hostname | github.com |
| None | e137814e266030874fd2c86863529d0622b13889eeda04148c57654b6ea84ad6 |
| turbo-cache-control | no-preview |
| go-import | github.com/stackitcloud/stackit-sdk-python git https://github.com/stackitcloud/stackit-sdk-python.git |
| octolytics-dimension-user_id | 55577607 |
| octolytics-dimension-user_login | stackitcloud |
| octolytics-dimension-repository_id | 872376182 |
| octolytics-dimension-repository_nwo | stackitcloud/stackit-sdk-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 872376182 |
| octolytics-dimension-repository_network_root_nwo | stackitcloud/stackit-sdk-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | dd58d68a7813bbec9c91422c8c35f4af33832d70 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width