Forum Discussion

Former Member's avatar
Former Member
3 years ago

fill address field from identity template

Hi
I try to create new identity item from CLI 2.14.0 on macOS
So i started from a template (op item template get Identity)
I have error trying to fill address field, as i don't know the expected json format. Seems this is a complex field that contain street, city, zip...

If i try with (format is what is got using op item get ... --format json

{
"id": "addr",
"section": {
"id": "address"
},
"type": "ADDRESS",
"label": "address",
"value": "mystreet, myzip, mycity, mycountry"
},

then i got error
[ERROR] 2023/02/21 08:18:23 validateVaultItem failed to Validate: Couldn't validate the item: "[ItemValidator] has found 1 errors, 0 warnings: \nErrors:{1. details.sections[2].fields[0].v has invalid type: \"string\". Requires one of [object] value}"

If i try with

{
"id": "addr",
"section": {
"id": "address"
},
"type": "ADDRESS",
"label": "address",
"value": {
"street": "mystreet",
"city": "mycity",
"country": "mycountry",
"zip": "myzip"
}

then i got error
[ERROR] 2023/02/21 08:19:12 Failed to create item: invalid JSON template: json: cannot unmarshal object into Go struct field ItemField.fields.value of type string

What is the expected format ? (i did't found documentation about that)


1Password Version: 8.10.0
Extension Version: CLI 2.14.0
OS Version: macOS
Browser:_ Not Provided

1 Reply

  • Former Member's avatar
    Former Member

    Did you ever figure this out?