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

[Tables] Adjust some enum settings to the latest autorest #21501

Merged
merged 2 commits into from
Nov 10, 2022

Conversation

YalinLi0312
Copy link
Member

Set some enums to be "modelAsString": false while generating with flag "--models-mode=msrest".

@openapi-workflow-bot
Copy link

Hi, @YalinLi0312 Thanks for your PR. I am workflow bot for review process. Here are some small tips.

  • Please ensure to do self-check against checklists in first PR comment.
  • PR assignee is the person auto-assigned and responsible for your current PR reviewing and merging.
  • For specs comparison cross API versions, Use API Specs Comparison Report Generator
  • If there is CI failure(s), to fix CI error(s) is mandatory for PR merging; or you need to provide justification in PR comment for explanation. How to fix?

  • Any feedback about review process or workflow bot, pls contact swagger and tools team. vscswagger@microsoft.com

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Nov 10, 2022

    Swagger Validation Report

    ️❌BreakingChange: 1 Errors, 0 Warnings failed [Detail]
    Rule Message
    Runtime Exception "new":"https://github.com/Azure/azure-rest-api-specs/blob/d31d88883f144eaf0ab9f91192c2f9acf0ff708c/specification/cosmos-db/data-plane/Microsoft.Tables/preview/2019-02-02/table.json",
    "old":"https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cosmos-db/data-plane/Microsoft.Tables/preview/2019-02-02/table.json",
    "details":"Command failed: node /mnt/vss/_work/_tasks/AzureApiValidation_5654d05d-82c1-48da-ad8f-161b817f6d41/0.0.44/common/temp/node_modules/.pnpm/@Azure+oad@0.10.2/node_modules/autorest/dist/app.js --v2 --input-file=specification/cosmos-db/data-plane/Microsoft.Tables/preview/2019-02-02/table.json --output-artifact=swagger-document.json --output-artifact=swagger-document.map --output-file=new --output-folder=/tmp\nERROR: Schema violation: Data does not match any schemas from 'oneOf'\n - file:///mnt/vss/_work/1/azure-rest-api-specs/specification/cosmos-db/data-plane/Microsoft.Tables/preview/2019-02-02/table.json:1877:4 ($.parameters.compAclParameter)\nERROR: Schema violation: Data does not match any schemas from 'oneOf'\n - file:///mnt/vss/_work/1/azure-rest-api-specs/specification/cosmos-db/data-plane/Microsoft.Tables/preview/2019-02-02/table.json:1777:4 ($.parameters.DataServiceVersionParameter)\nERROR: Schema violation: Data does not match any schemas from 'oneOf'\n - file:///mnt/vss/_work/1/azure-rest-api-specs/s"
    ️️✔️Breaking Change(Cross-Version) succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️⚠️LintDiff: 0 Warnings warning [Detail]
    compared tags (via openapi-validator v2.0.0) new version base version
    package-2019-02 package-2019-02(d31d888) package-2019-02(main)

    The following errors/warnings exist before current PR submission:

    Only 30 items are listed, please refer to log for more details.

    Rule Message
    HostParametersValidation The host parameter must be called 'endpoint'.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L16
    HostParametersValidation The host parameter must be typed 'type 'string', format 'url''.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L16
    XmsPathsMustOverloadPaths Paths in x-ms-paths must overload a normal path in the paths section, i.e. a path in the x-ms-paths must either be same as a path in the paths section or a path in the paths sections followed by additional parameters.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L1058
    XmsPathsMustOverloadPaths Paths in x-ms-paths must overload a normal path in the paths section, i.e. a path in the x-ms-paths must either be same as a path in the paths section or a path in the paths sections followed by additional parameters.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L1210
    MissingTypeObject The schema 'Metrics' is considered an object but without a 'type:object', please add the missing 'type:object'.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L1401
    IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L1476
    IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L1503
    IntegerTypeMustHaveFormat The integer type does not have a format, please add it.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L1744
    ⚠️ DeprecatedXmsCodeGenerationSetting The x-ms-code-generation-setting extension is being deprecated. Please remove it and move settings to readme file for code generation.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L6
    ⚠️ LicenseHeaderMustNotBeSpecified License header must not be specified inside x-ms-code-generation-settings. This is different for different sdks generated and is passed via command line/config file when generating the sdk.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L6
    ⚠️ SecurityDefinitionDescription Security definition should have a description.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L22
    ⚠️ ListInOperationName Since operation response has model definition in array type, it should be of the form '_list'.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L39
    ⚠️ PageableOperation Based on the response model schema, operation 'Table_Query' might be pageable. Consider adding the x-ms-pageable extension.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L39
    ⚠️ PaginationResponse Operation might be pageable. Consider adding the x-ms-pageable extension.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L39
    ⚠️ GetInOperationName 'GET' operation 'Table_Query' should use method name 'Get' or Method name start with 'List'. Note: If you have already shipped an SDK on top of this spec, fixing this warning may introduce a breaking change.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L43
    ⚠️ OperationId OperationId for get method should contain 'Get' or 'list'
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L43
    ⚠️ VersionPolicy Operation does not define an 'api-version' query parameter.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L50
    ⚠️ ParameterNamesConvention header parameter name 'DataServiceVersion' should be kebab case.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L57
    ⚠️ ParameterNamesConvention Parameter name '$format' should not begin with '$' or '@'.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L60
    ⚠️ ParameterNamesConvention Parameter name '$top' should not begin with '$' or '@'.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L63
    ⚠️ ParameterNamesConvention Parameter name '$select' should not begin with '$' or '@'.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L66
    ⚠️ ParameterNamesConvention Parameter name '$filter' should not begin with '$' or '@'.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L69
    ⚠️ ParameterNamesConvention Parameter name 'NextTableName' should be camel case.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L73
    ⚠️ DefaultResponse Operation is missing a default response.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L80
    ⚠️ VersionPolicy Operation does not define an 'api-version' query parameter.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L126
    ⚠️ ParameterNamesConvention header parameter name 'DataServiceVersion' should be kebab case.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L133
    ⚠️ ParameterNamesConvention Parameter name '$format' should not begin with '$' or '@'.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L136
    ⚠️ Post201Response Using post for a create operation is discouraged.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L147
    ⚠️ ErrorResponse Error response schema should contain an object property named error.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L216
    ⚠️ PathCharacters Path contains non-recommended characters.
    Location: Microsoft.Tables/preview/2019-02-02/table.json#L223
    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️ApiReadinessCheck succeeded [Detail] [Expand]
    ️⚠️~[Staging] ServiceAPIReadinessTest: 0 Warnings warning [Detail]

    API Test is not triggered due to precheck failure. Check pipeline log for details.

    ️❌~[Staging] SwaggerAPIView: 0 Errors, 0 Warnings failed [Detail]
    ️❌ModelValidation: 5 Errors, 0 Warnings failed [Detail]
    Rule Message
    XMS_EXAMPLE_NOTFOUND_ERROR x-ms-example not found in Table_GetAccessPolicy.
    Url: Microsoft.Tables/preview/2019-02-02/table.json#L911:14
    XMS_EXAMPLE_NOTFOUND_ERROR x-ms-example not found in Table_SetAccessPolicy.
    Url: Microsoft.Tables/preview/2019-02-02/table.json#L983:14
    XMS_EXAMPLE_NOTFOUND_ERROR x-ms-example not found in Service_SetProperties.
    Url: Microsoft.Tables/preview/2019-02-02/table.json#L1087:14
    XMS_EXAMPLE_NOTFOUND_ERROR x-ms-example not found in Service_GetProperties.
    Url: Microsoft.Tables/preview/2019-02-02/table.json#L1148:14
    XMS_EXAMPLE_NOTFOUND_ERROR x-ms-example not found in Service_GetStatistics.
    Url: Microsoft.Tables/preview/2019-02-02/table.json#L1239:14
    ️️✔️SemanticValidation succeeded [Detail] [Expand]
    Validation passes for SemanticValidation.
    ️️✔️PoliCheck succeeded [Detail] [Expand]
    Validation passed for PoliCheck.
    ️️✔️PrettierCheck succeeded [Detail] [Expand]
    Validation passes for PrettierCheck.
    ️️✔️SpellCheck succeeded [Detail] [Expand]
    Validation passes for SpellCheck.
    ️️✔️Lint(RPaaS) succeeded [Detail] [Expand]
    Validation passes for Lint(RPaaS).
    ️️✔️CadlValidation succeeded [Detail] [Expand]
    Validation passes for CadlValidation.
    ️️✔️PR Summary succeeded [Detail] [Expand]
    Validation passes for Summary.
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Nov 10, 2022

    Swagger pipeline restarted successfully, please wait for status update in this comment.

    @openapi-pipeline-app
    Copy link

    Swagger pipeline started successfully. If there is ApiView generated, it will be updated in this comment.

    @openapi-workflow-bot
    Copy link

    Hi @YalinLi0312, Your PR has some issues. Please fix the CI sequentially by following the order of Avocado, semantic validation, model validation, breaking change, lintDiff. If you have any questions, please post your questions in this channel https://aka.ms/swaggersupport.

    TaskHow to fixPriority
    AvocadoFix-AvocadoHigh
    Semantic validationFix-SemanticValidation-ErrorHigh
    Model validationFix-ModelValidation-ErrorHigh
    LintDiffFix-LintDiffhigh
    If you need further help, please feedback via swagger feedback.

    @lmazuel
    Copy link
    Member

    lmazuel commented Nov 10, 2022

    Merging, as this is bringing back the the "automatic constant" behavior from a previous M4 release, like former tables were released. It may have consequences in other languages than Python in their convenience layer, but no customer impact

    @lmazuel lmazuel merged commit 58767be into Azure:main Nov 10, 2022
    @YalinLi0312 YalinLi0312 deleted the yall-tables-includemodel branch November 10, 2022 22:32
    anandanthony pushed a commit to anandMicro/azure-rest-api-specs that referenced this pull request Dec 16, 2022
    * Update output folder to tables
    
    * Update table.json
    kayousef-zz pushed a commit to kayousef-zz/azure-rest-api-specs that referenced this pull request Dec 21, 2022
    * Update output folder to tables
    
    * Update table.json
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    4 participants