-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
items.get throws PydanticSchemaGenerationError #108
Comments
Hey @gregorias ! Thanks for reaching out about this bug. The functionality you're using should be supported and this is indeed a bug. We will look into it! |
Hey @gregorias, could you share more about the project setup in which this error occurs? We're attempting to reproduce this issue and we were wondering whether:
|
So while working the questions, I made the issue disappear by specifying onepassword = { git = "https://github.com/1Password/onepassword-sdk-python.git", tag = 'v0.1.1' } It was like this before: onepassword = { git = "https://github.com/1Password/onepassword-sdk-python.git" } and it was installing d9e45c9. 713e09f, on the other hand, works fine. Here’s a script that I am using to reproduce this issue: # repro.py
from onepassword.client import Client # type: ignore
async def get_vault_id(client, vault_name: str) -> str | None:
async for vault in await client.vaults.list_all():
if vault.title == vault_name:
return vault.id
return None
async def get_item_id(client, vault_id, item_name: str) -> str | None:
async for item in await client.items.list_all(vault_id):
if item.title == item_name:
return item.id
return None
async def main():
client = await Client.authenticate(
auth=
'redacted_for_obvious_reasons',
integration_name="Findata Fetcher",
integration_version="1.0.0")
af_vault_id = await get_vault_id(client, 'Redacted')
af_item_id = await get_item_id(client, af_vault_id, 'degiro.nl')
item = await client.items.get(af_vault_id, af_item_id)
return client, af_vault_id, af_item_id, item
if __name__ == '__main__':
import asyncio
asyncio.run(main()) I am running this in the virtual environment created for Findata Fetcher by Poetry. I added a print to {
"id": "redacted",
"title": "degiro.nl",
"category": "Login",
"vaultId": "redacted",
"fields": [
{
"id": "username",
"title": "username",
"sectionId": null,
"fieldType": "Text",
"value": "redacted",
"details": null
},
{
"id": "password",
"title": "password",
"sectionId": null,
"fieldType": "Concealed",
"value": "redacted",
"details": null
},
{
"id": "TOTP_redacted",
"title": "one-time password",
"sectionId": "add more",
"fieldType": "Totp",
"value": "redacted",
"details": {
"type": "Otp",
"content": {
"code": "redacted",
"errorMessage": null
}
}
},
{
"id": "redacted",
"title": "mobile app code",
"sectionId": "add more",
"fieldType": "Concealed",
"value": "redacted",
"details": null
}
],
"sections": [
{
"id": "add more",
"title": ""
}
],
"version": 4
} Looks like I’m using Pydantic at 2.9.0, but I can also reproduce it at 2.9.1. |
Scenario & Reproduction Steps
I have an item that looks like this:
And I try to fetch it with
op_client.items.get(vault_id, item_id)
.Actual Behavior
The
get
function throws:Expected Behavior
The SDK should return the relevant item or at least an exception that is relevant to the caller (e.g., that the functionality is not implemented).
SDK version
0.1.1
Additional information
No response
The text was updated successfully, but these errors were encountered: