Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with upstream Swagger/JSON schemas #1453

Open
matthchr opened this issue Nov 12, 2020 · 6 comments
Open

Problems with upstream Swagger/JSON schemas #1453

matthchr opened this issue Nov 12, 2020 · 6 comments
Assignees

Comments

@matthchr
Copy link
Member

matthchr commented Nov 12, 2020

This is a place to catalog issues we've noticed with upstream Swagger/JSON specs. Once we've got a large list we can submit PRs or Issues to the corresponding specs. Note that this isn't complete and should be combined with an examination of the azure-arm.yaml configuration file to see what other problems we are working around with config overrides.

Issues with Swagger

Storage

  • StorageAccountPropertiesCreateParameters is listed as optional on the spec, but really has a required field AccessTier without which the account will not create successfully.
  • StorageAccountsQueueServicesQueue uses a regex that doesn’t conform to the JSON Schema recommendations and cannot be parsed by the Go stdlib (^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$)
  • NetworkAcls bypass is documented as an enum but actually accepts a comma-separated list of values, which isn't what enum means.

Compute

  • Uses anyOf when we think they want oneOf. Affected types:
    • extensions (2015-08-01, 2017-03-30, 2017-12-01)
    • extensionsChild (2015-08-01, 2017-03-30, 2017-12-01)
  • vmssExtensions (2017-12-01)
  • VirtualMachineScaleSetExtension (2018-06-01, 2018-10-01, 2019-03-01, 2019-07-01)
  • virtualMachines_extensions (2018-06-01, 2018-10-01, 2019-03-01, 2019-07-01)
  • virtualMachineScaleSets_extensions (2018-06-01, 2018-10-01, 2019-03-01, 2019-07-01)
  • VirtualMachineScaleSetIPConfiguration inherits Id from SubResource, but as far as I can tell that Id field isn't actually ever used in a PUT. If that's the ID of the ARM resource created by the PUT (and no other way?) then it should be readonly? The whole "can only make this resource as a property of another resource" is weird in general.
  • I think that when compute SubResource is used directly (as a property or something), it's meaning is that of a reference. When it's used via inheritance, then the reference is to self.

Container Services

  • ContainerServiceWindowsProfile and ManagedClusterWindowsProfile use a regex that doesn’t conform to the JSON Schema recommendations and cannot be parsed by the Go stdlib (^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\\^&\\*\\(\\)])[a-zA-Z\\d!@#$%\\^&\\*\\(\\)]{12,123}$)

Healthcare

  • Uses anyOf when we think they want oneOf. Affected types (in 2019-09-16):
    • ServiceCorsConfigurationInfo

Not present any more as of this commit.

Insights

  • Uses anyOf when we think they want oneOf. Affected types (in 2016-03-01):
    • RuleDataSource
    • RuleCondition
    • RuleAction

Not present any more as of this commit.

  • 2020-02-02 REST API for components has component.workspaceId documented as required but not actually marked required in the schema. In reality it is not required as far as I can tell, so it's just a documentation issue.
  • The 2018-05-01-preview API says there are only 2 allowed fields for kind, but in reality there are at least a few more, standard is one of the additional ones. Actually you can see this in the other kind defined in this file. I think the issue is they should just prune the top level kind in the WebTest.

KeyVault

  • Uses anyOf when we think they want oneOf. Affected types (in 2015-06-01):
    • permissions

Fixed in 2016-10-01.

RecoveryServices

  • Uses anyOf when we think they want oneOf. Affected types (in 2018-01-10):
    • FabricSpecificCreationInput
    • EnableProtectionProviderSpecificInput
    • FabricSpecificCreateNetworkMappingInput
    • PolicyProviderSpecificInput
    • RecoveryPlanActionDetails

Sendgrid

  • Uses anyOf when we think they want oneOf. Affected types (in 2015-01-01):
    • accounts

ServiceBus

  • SBNamespaceProperties in 2021-01-01-preview APIVersion has privateEndpointConnections which should be marked readOnly but isn't.

Issues with JSON Schema

Common

i.e. in https://schema.management.azure.com/schemas/common/definitions.json

Network

  • Virtual Network (2017-10-01):
    • has ProvisioningState in its spec
    • location marked optional but is not
    • addressspace/addressprefixes are required but not marked as such
    • WHAT IS RESOURCEGUID
@Porges Porges transferred this issue from Azure/k8s-infra May 14, 2021
@matthchr matthchr added this to the codegen-beta-0 milestone Nov 1, 2021
@matthchr
Copy link
Member Author

We should push this back up to the Swagger repo at least (JSON schema ones we already have, for the most part)

@matthchr
Copy link
Member Author

We should work with the upstream Swagger folks on this

@matthchr matthchr self-assigned this May 22, 2023
@matthchr
Copy link
Member Author

No change on the above - we should work towards resolving this issue in favor of fixing upstream Swagger issues and/or opening issues.

@matthchr
Copy link
Member Author

matthchr commented Dec 4, 2023

@matthchr will go through the Swagger issues and convert them to issues on the azure-rest-api-specs repo

@theunrepentantgeek theunrepentantgeek modified the milestones: v2.6.0, v2.7.0 Dec 11, 2023
@matthchr matthchr removed this from the v2.7.0 milestone Feb 22, 2024
@matthchr
Copy link
Member Author

No change from above -- Matt will work on this (it's on the list)

@matthchr
Copy link
Member Author

No change from above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants