Skip to content

TypeScript types for the azure-iot-provisioning-service library appear to be incorrect #1199

@mccolljr

Description

@mccolljr

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"
  1. 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?

  2. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions