Skip to content

additionalProperties field missing from generated models #4859

@ezhong-msft

Description

@ezhong-msft

I've been looking to do a migration from kermit to go-azure-sdk for the azurerm data factory resources and have encountered an issue.
The Azure API spec for Data Factory LinkedService has a field additionalProperties which represents a dictionary of values that can be added to the request body as defined in OpenAPI 3.0. https://swagger.io/docs/specification/v3_0/data-models/dictionaries/

The kermit library is able to extract this field into its models and accounts for it when marshalling with a custom JSON marshaler for the type, manually extracting each additional property as it's own field. However, the go-azure-sdk version of this does not seem to have this. The field is ignored when marshalling into the BaseLinkedService type for the request body since it does not exist in the struct.

Investigating the imported api definitions for this model, it seems like the spec importer may not account for this field as it is missing from the first step?

I've seen existing additionalProperties fields in the pandora api-definitions (other than explicitly defined ones) however it is nested (as are the test data) so I'm hazarding a guess that it may be because it is at the root level? I believe there was a related issue addressed a while back #96 but this only seems to cover the nested additionalProperties.

I've briefly step through this custom data factory test adding an additionalProperties at the root level

It seems to never reach this line to process the field because there are existing properties?

if input.AdditionalProperties != nil && input.AdditionalProperties.Schema != nil {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions