In the last hour I have encountered two scenarios where the TypeScript types are completely incorrect for the azure-iot-provisioning-service library.
This is the version I am using:
"azure-iot-provisioning-service": "^1.11.2"
-
The createOrUpdateIndividualEnrollment method on the client takes an IndividualEnrollment object as input. The IndividualEnrollment object does not consider any of the fields optional, despite the fact that the endpoint will accept a very small subset of fields. Why is there not a separate input type which accurately reflects which fields are required?
-
The createIndividualEnrollmentQuery method on the client returns a Query object. The user is then supposed to call the Query object's next method to receive result pages. The type annotations for this next method indicate that the returned object has a responseBody property of the form { items: Array<one | of | many | things> }, but the actual value returned from the API is the items array directly.
Based on the limited testing I have done, I am certain that there would be other areas where types are incorrect. Is this a matter of re-generating these types from the underlying API specification? What can be done to resolve this?
In the last hour I have encountered two scenarios where the TypeScript types are completely incorrect for the
azure-iot-provisioning-servicelibrary.This is the version I am using:
The
createOrUpdateIndividualEnrollmentmethod on the client takes anIndividualEnrollmentobject as input. TheIndividualEnrollmentobject does not consider any of the fields optional, despite the fact that the endpoint will accept a very small subset of fields. Why is there not a separate input type which accurately reflects which fields are required?The
createIndividualEnrollmentQuerymethod on the client returns aQueryobject. The user is then supposed to call theQueryobject'snextmethod to receive result pages. The type annotations for thisnextmethod indicate that the returned object has aresponseBodyproperty of the form{ items: Array<one | of | many | things> }, but the actual value returned from the API is the items array directly.Based on the limited testing I have done, I am certain that there would be other areas where types are incorrect. Is this a matter of re-generating these types from the underlying API specification? What can be done to resolve this?