question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duplicate schema coming from nowhere

See original GitHub issue

Before filling a bug

  • have you checked the faq for known issues.
  • have you checked existing issues

Describe the bug

I am getting the following duplicate schema issues:

  error   | PreCheck/DuplicateSchema | Duplicate Schema named 'KeyVaultProperties' (4 differences):
    - properties: {"keyName":{"x-ms-client-name":"KeyName","$ref":"#/components/schemas/schemas:36","description":"Name of the Key from KeyVault"},"keyVaultUri":{"x-ms-client-name":"KeyVaultUri","$ref":"#/components/schemas/schemas:37","description":"Uri of KeyVault"},"keyVersion":{"x-ms-client-name":"KeyVersion","$ref":"#/components/schemas/schemas:38","description":"Key Version"},"identity":{"$ref":"#/components/schemas/schemas:63"}} => <none>
    - type: "object" => "array"
    - items: <none> => {"$ref":"#/components/schemas/schemas:35"}
    - x-ms-client-name: <none> => "KeyVaultProperties"; This error can be *temporarily* avoided by using the 'modelerfour.lenient-model-deduplication' setting.  NOTE: This setting will be removed in a future version of @autorest/modelerfour; schemas should be updated to fix this issue sooner than that.

Looks like it is comparing a model (here) and a property (here). I am not sure if the x-ms-client-flatten is involved or not, but it looks like to be involved.

To reproduce, you need to

  1. change the version of autorest.csharp here from 3.0.0-beta.20220426.2 to 3.0.0-beta.20220426.4
  2. go to this directory and run dotnet build /t:GenerateCode

Expected behavior

We do not have a duplicate schema previously, therefore we do not want a duplicate schema issue if we did not change the swagger.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
archerzzcommented, Apr 29, 2022

@timotheeguerin I tried the fix, and it works. Thanks!

0reactions
timotheeguerincommented, Apr 29, 2022

waiting on confirmation that this other bug #4523 fixed in the same PR is resolved and then will merge and the fix should be available.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloning a schema with a one line command - Connor McDonald
What about if the “unit of work” is not an entire pluggable database. What if we just want to clone just a schema...
Read more >
Duplicate field 'HowTo' new error - WordPress.org
I have a few pages on my site that utilize the Yoast 'How To' block. In the last few days, with no editing...
Read more >
Clone schema without copying table grants
According to docs, Cloning a schema clones all the contained objects in the schema. Though as a workaround, you can use time travel...
Read more >
Unexpected MongoServerError 11000 (duplicate) for a field ...
I should note that nowhere in my code is 'products.name' mentioned. ERROR: MongoServerError: E11000 duplicate key error collection: ...
Read more >
Copy only Schema to an other database - FME Community
Hello. Is there a way we could copy only the schema ( table name and related attribute ) no data into another database,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found