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

[Bug]: Cannot suppress certain warnings #6110

Open
4 tasks done
catalinaperalta opened this issue Feb 21, 2025 · 1 comment
Open
4 tasks done

[Bug]: Cannot suppress certain warnings #6110

catalinaperalta opened this issue Feb 21, 2025 · 1 comment
Labels
bug Something isn't working needs-area

Comments

@catalinaperalta
Copy link
Member

Describe the bug

Ran into the following warnings+errors when compiling this spec and can't suppress them:

PS C:\Users\caperal\repos\azure-rest-api-specs\specification\storage\Microsoft.BlobStorage> tsp compile .                 
TypeSpec compiler v0.64.0

Diagnostics were reported during compilation:

../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'metadata'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'metadata'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'objectReplicationRules'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'metadata'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'objectReplicationRules'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'metadata'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'objectReplicationRules'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'metadata'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'metadata'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^
../C:/Users/caperal/repos/azure-rest-api-specs/node_modules/@typespec/compiler/lib/intrinsics.tsp:191:7 - warning @azure-tools/typespec-autorest/unsupported-param-type: Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part 'x-ms-meta'.
> 191 | model Record<Element> {}
      |       ^^^^^^
  ../C:/Users/caperal/repos/azure-rest-api-specs/specification/storage/Microsoft.BlobStorage/models.tsp:208:36 - occurred while instantiating template
  > 208 |   @Xml.name("Metadata") metadata?: Record<string>;
        |                                    ^^^^^^^^^^^^^^

Found 20 warnings.

Since warnings are shown as errors in ci in the specs repo, this will block merging the PR. Spoke to @timotheeguerin who suggested the error might need to be moved in order to be able to suppress it in the spec.

Reproduction

Link to spec: https://github.com/Azure/azure-rest-api-specs/tree/feature/blob-tsp/specification/storage/Microsoft.BlobStorage

Example definition causing the problem:

Checklist

@catalinaperalta catalinaperalta added the bug Something isn't working label Feb 21, 2025
@timotheeguerin
Copy link
Member

I think for this specific error it should be emitted on teh parameter instead which would solve this specific case.

But more genericaly we have to decide how we can suppress those errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-area
Projects
None yet
Development

No branches or pull requests

2 participants