Azure / autorest.java

Extension for AutoRest (https://github.com/Azure/autorest) that generates Java code
MIT License
32 stars 80 forks source link

mgmt, schemacleanup bug fix #2754

Closed XiaofeiCao closed 1 month ago

XiaofeiCao commented 1 month ago

fix https://github.com/Azure/autorest.java/pull/2698#discussion_r1596521990

Currently, include all schema's parents into calculation. Yet to see whether this is an overkill...

Previous schema clean up logic:

  1. Rough calculate unused schemas set
  2. Properties of schemas are in use, remove them from unused schemas set
  3. Schemas in operation requests are in use, remove them from unused schemas set
  4. Schemas in operation responses are in use, remove them from unused schemas set
  5. Schemas in Exceptions are in use, remove them from unused schemas set

This PR adds an extra schema in use: For schema in schemasInUse, its collection parents(Dictionary, Array)'s element schemas are in use, remove them from unused schemas set.