PaloAltoNetworks / PaloAltoNetworks/pan.dev
Issue/Help with "Update a Tag"
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 78
- Forks
- 88
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 18
Description
Documentation link
https://pan.dev/compute/api/put-tags-id/
resourceType vuln.TagType
Possible values: [image,host,function,codeRepo,]
Describe the problem
Specifically using API version 31.01, the documentation appears to suggest that resourceType is an array in both documentation and code examples on the documentation page. This is not the case, if you try to pass this value in as an array you will get the following error message in the console logs.
"Operation failed: uri=/api/v31.01/tags; error=failed to unmarshal: json: cannot unmarshal array into Go struct field TagVulnMetadata.vulns.resourceType of type vuln.TagType"
Using the Get Tags API, we can see that the resourceType item is actually a string value, not an array. Setting this value as a string and POSTing to the /tags endpoint correctly creates the intended tag.
Suggested fix
Make the documentation more clear that this is not an array type field, it is a string.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Update a Tag API page for API version 31.01 and inspect the resourceType description and examples. Change the documentation to identify resourceType as a string rather than an array, then verify the examples match the Get Tags response and the tags endpoint behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100