Azure / Azure/azure-rest-api-specs
CertificateCollection Mislabeled
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 37m
- Merged PRs (30d)
- 446
Description
> In Azure/azure-sdk-for-go#695, @shreyakanika15 says:
> Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal array into Go value of type web.CertificateCollection. I have attached logs of error and go code file which is returning the error.
[mynewserver.pdf](https://github.com/Azure/azure-sdk-for-go/files/1174010/mynewserver.pdf)
>.
>
> [Log_error.pdf](https://github.com/Azure/azure-sdk-for-go/files/1173998/Log_error.pdf)
I tracked down the source of the failed unmarshaling to the [defintion of CertificateCollection](https://github.com/Azure/azure-rest-api-specs/blob/087554c4480e144f715fe92f97621ff5603cd907/specification/web/resource-manager/Microsoft.Web/2016-03-01/Certificates.json#L412). The service is returning an array of certificates, yet the Swagger states that there will be an object with a key "value" which contains an array of certificates.
This definition should be updated.
Contributor guide
Research direction
Open specification/web/resource-manager/Microsoft.Web/2016-03-01/Certificates.json and inspect the CertificateCollection definition around line 412. Compare that schema with the service response described in this issue, then validate the updated specification; done means the definition accepts the returned certificate array.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100