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

[Maps] Adding Operations for airQuality (current, forecast/daily/ and forecast/hourly) to weather swagger #15249

Closed
wants to merge 6 commits into from

Conversation

john35452
Copy link
Contributor

This is a PR generated at OpenAPI Hub. You can view your work branch via this link.

Changelog

Please ensure to add changelog with this PR by answering the following questions.

  1. What's the purpose of the update?
    • new service onboarding
    • new API version
    • update existing version for new feature
    • update existing version to fix swagger quality issue in s360
    • Other, please clarify
  2. When you are targeting to deploy new service/feature to public regions? Please provide date, or month to public if date is not available yet.
  3. When you expect to publish swagger? Please provide date, or month to public if date is not available yet.
  4. If it's an update to existing version, please select SDKs of specific language and CLIs that require refresh after swagger is published.
    • SDK of .NET (need service team to ensure code readiness)
    • SDK of Python
    • SDK of Java
    • SDK of Js
    • SDK of Go
    • PowerShell
    • CLI
    • Terraform
    • No, no need to refresh for updates in this PR

Contribution checklist:

If any further question about AME onboarding or validation tools, please view the FAQ.

ARM API Review Checklist

  • Ensure to check this box if one of the following scenarios meet updates in the PR, so that label “WaitForARMFeedback” will be added automatically to involve ARM API Review. Failure to comply may result in delays for manifest application. Note this does not apply to data plane APIs, all “removals” and “adding a new property” no more require ARM API review.

    • Adding new API(s)
    • Adding a new API version
    • Ensure to copy the existing version into new directory structure for first commit (including refactoring) and then push new changes including version updates in separate commits. This is required to review the changes efficiently.
    • Adding a new service
  • Please ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.

  • If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.

Breaking Change Review Checklist

If there are following updates in the PR, ensure to request an approval from Breaking Change Review Board as defined in the Breaking Change Policy.

  • Removing API(s) in stable version
  • Removing properties in stable version
  • Removing API version(s) in stable version
  • Updating API in stable or public preview version with Breaking Change Validation errors
  • Updating API(s) in public preview over 1 year (refer to Retirement of Previews)

Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki.

Please follow the link to find more details on PR review process.

@openapi-workflow-bot
Copy link

Hi, @john35452 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. vsswagger@microsoft.com

    @openapi-workflow-bot
    Copy link

    [Call for Action] To better understand Azure service dev/test scenario, and support Azure service developer better on Swagger and REST API related tests in early phase, please help to fill in with this survey https://aka.ms/SurveyForEarlyPhase. It will take 5 to 10 minutes. If you already complete survey, please neglect this comment. Thanks.

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jul 19, 2021

    Swagger Validation Report

    ️❌BreakingChange: 3 Errors, 0 Warnings failed [Detail]
    Rule Message
    1038 - AddedPath The new version is adding a path that was not found in the old version.
    New: Weather/preview/1.0/weather.json#L713:5
    1038 - AddedPath The new version is adding a path that was not found in the old version.
    New: Weather/preview/1.0/weather.json#L774:5
    1038 - AddedPath The new version is adding a path that was not found in the old version.
    New: Weather/preview/1.0/weather.json#L839:5
    ️❌LintDiff: 1 Errors, 0 Warnings failed [Detail]
    The following errors/warnings are introduced by current PR:
    Rule Message
    R4001 - XmsParameterLocation The parameter 'pollutants' is defined in global parameters section without 'x-ms-parameter-location' extension. This would add the parameter as the client property. Please ensure that this is exactly you want. If so, apply the extension 'x-ms-parameter-location': 'client'. Else, apply the extension 'x-ms-parameter-location': 'method'.
    Location: Weather/preview/1.0/weather.json#L79


    The following errors/warnings exist before current PR submission:

    Rule Message
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Feedback/preview/1.0/feedback.json#L216
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Mobility/preview/1.0/mobility.json#L1464
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Mobility/preview/1.0/mobility.json#L1491
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Route/preview/1.0/route.json#L1813
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Route/preview/1.0/route.json#L1855
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Route/preview/1.0/route.json#L1878
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Route/preview/1.0/route.json#L1969
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Search/preview/1.0/search.json#L2075
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Spatial/preview/1.0/spatial.json#L1095
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Spatial/preview/1.0/spatial.json#L1118
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Spatial/preview/1.0/spatial.json#L1148
    R2026 - AvoidAnonymousTypes Inline/anonymous models must not be used, instead define a schema with a model name in the 'definitions' section and refer to it. This allows operations to share the models.
    Location: Spatial/preview/1.0/spatial.json#L1175
    ⚠️ R2007 - LongRunningOperationsWithLongRunningExtension The operation 'Dataset_Create' returns 202 status code, which indicates a long running operation, please enable 'x-ms-long-running-operation.
    Location: Dataset/preview/2.0/dataset.json#L196
    ⚠️ R2007 - LongRunningOperationsWithLongRunningExtension The operation 'Conversion_Convert' returns 202 status code, which indicates a long running operation, please enable 'x-ms-long-running-operation.
    Location: DwgConversion/preview/2.0/dwgconversion.json#L203
    ⚠️ R2007 - LongRunningOperationsWithLongRunningExtension The operation 'Tileset_Create' returns 202 status code, which indicates a long running operation, please enable 'x-ms-long-running-operation.
    Location: Tileset/preview/2.0/tileset.json#L216
    ⚠️ R2018 - XmsEnumValidation The enum types should have x-ms-enum type extension set with appropriate options. Property name: type
    Location: FeatureState/preview/2.0/featurestate.json#L827
    ⚠️ R2018 - XmsEnumValidation The enum types should have x-ms-enum type extension set with appropriate options. Property name: type
    Location: Search/preview/1.0/search.json#L3448
    ⚠️ R2018 - XmsEnumValidation The enum types should have x-ms-enum type extension set with appropriate options. Property name: geometryType
    Location: WFS/preview/2.0/wfs.json#L887
    ⚠️ R2064 - LROStatusCodesReturnTypeSchema 200/201 Responses of long running operations must have a schema definition for return type. OperationId: 'FeatureState_PutStateset', Response code: '200'
    Location: FeatureState/preview/2.0/featurestate.json#L325
    ⚠️ R2064 - LROStatusCodesReturnTypeSchema 200/201 Responses of long running operations must have a schema definition for return type. OperationId: 'FeatureState_UpdateStates', Response code: '200'
    Location: FeatureState/preview/2.0/featurestate.json#L465
    ️️✔️Avocado succeeded [Detail] [Expand]
    Validation passes for Avocado.
    ️️✔️ModelValidation succeeded [Detail] [Expand]
    Validation passes for ModelValidation.
    ️️✔️SemanticValidation succeeded [Detail] [Expand]
    Validation passes for SemanticValidation.
    ️️✔️Cross-Version Breaking Changes succeeded [Detail] [Expand]
    There are no breaking changes.
    ️️✔️CredScan succeeded [Detail] [Expand]
    There is no credential detected.
    ️️✔️[Staging] SDK Track2 Validation succeeded [Detail]
    The following errors/warnings are introduced by current PR:

    |:speech_balloon: AutorestCore/Exception|"readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"> Installing AutoRest extension '@microsoft.azure/openapi-validator' (1.8.0)"|
    |:speech_balloon: AutorestCore/Exception|"readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"> Installed AutoRest extension '@microsoft.azure/openapi-validator' (1.8.0->1.8.0)"|


    The following errors/warnings exist before current PR submission:

    Rule Message
    PreCheck/DuplicateSchema "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Duplicate Schema named ODataErrorResponse -- properties.error.$ref: undefined => "#/components/schemas/schemas:39" ; 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."
    PreCheck/DuplicateSchema "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Duplicate Schema named ODataError -- properties.details.$ref: undefined => "#/components/schemas/schemas:42" ; 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."
    PreCheck/DuplicateSchema "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Duplicate Schema named LongRunningOperationResult -- properties.error.$ref: undefined => "#/components/schemas/schemas:74",
    properties.warning.$ref: undefined => "#/components/schemas/schemas:74" ; 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."
    PreCheck/DuplicateSchema "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Duplicate Schema named CoordinateAbbreviated -- properties.lat.$ref: undefined => "#/components/schemas/schemas:858",
    properties.lat.readOnly: undefined => true,
    properties.lon.$ref: undefined => "#/components/schemas/schemas:859",
    properties.lon.readOnly: undefined => true ; 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."
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Schema 'Point' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Schema 'Polygon' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Schema 'LineString' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Schema 'MultiPoint' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Schema 'MultiPolygon' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Schema 'MultiLineString' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    AutorestCore/Exception "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"Error: Plugin prechecker reported failure."
    PreCheck/DuplicateSchema "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Duplicate Schema named ODataErrorResponse -- properties.error.$ref: undefined => "#/components/schemas/schemas:36" ; 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."
    PreCheck/DuplicateSchema "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Duplicate Schema named ODataError -- properties.details.$ref: undefined => "#/components/schemas/schemas:39" ; 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."
    PreCheck/DuplicateSchema "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Duplicate Schema named LongRunningOperationResult -- properties.error.$ref: undefined => "#/components/schemas/schemas:73",
    properties.warning.$ref: undefined => "#/components/schemas/schemas:73" ; 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."
    PreCheck/DuplicateSchema "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Duplicate Schema named CoordinateAbbreviated -- properties.lat.$ref: undefined => "#/components/schemas/schemas:856",
    properties.lat.readOnly: undefined => true,
    properties.lon.$ref: undefined => "#/components/schemas/schemas:857",
    properties.lon.readOnly: undefined => true ; 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."
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Schema 'Point' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Schema 'Polygon' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Schema 'LineString' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Schema 'MultiPoint' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Schema 'MultiPolygon' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    PreCheck/PropertyRedeclaration "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Schema 'MultiLineString' has a property 'type' that is conflicting with a property in the parent schema 'GeoJSONGeometry' differs more than just description : [x-ms-enum => '',
    enum => '']"
    AutorestCore/Exception "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"Error: Plugin prechecker reported failure."
    💬 AutorestCore/Exception "readme":"maps/data-plane/readme.md",
    "tag":"package-preview-2.0",
    "details":"> Loading AutoRest extension '@autorest/modelerfour' (4.15.456->4.15.456)"
    💬 AutorestCore/Exception "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"> Loading AutoRest extension '@microsoft.azure/openapi-validator' (1.8.0->1.8.0)"
    💬 AutorestCore/Exception "readme":"maps/data-plane/readme.md",
    "tag":"package-1.0-preview",
    "details":"> Loading AutoRest extension '@autorest/modelerfour' (4.15.456->4.15.456)"
    ️️✔️[Staging] PrettierCheck succeeded [Detail] [Expand]
    Validation passes for PrettierCheck.
    ️️✔️[Staging] SpellCheck succeeded [Detail] [Expand]
    Validation passes for SpellCheck.
    ️️✔️[Staging] Lint(RPaaS) succeeded [Detail] [Expand]
    Validation passes for Lint(RPaaS).
    Posted by Swagger Pipeline | How to fix these errors?

    @openapi-pipeline-app
    Copy link

    openapi-pipeline-app bot commented Jul 19, 2021

    Swagger Generation Artifacts

    ️️✔️[Staging] ApiDocPreview succeeded [Detail] [Expand]
     Please click here to preview with your @microsoft account. 
    ️️✔️[Staging] SDK Breaking Change Tracking succeeded [Detail] [Expand]

    Breaking Changes Tracking

    Posted by Swagger Pipeline | How to fix these errors?

    @john35452 john35452 added the DoNotMerge <valid label in PR review process> use to hold merge after approval label Jul 19, 2021
    @openapi-workflow-bot
    Copy link

    NewApiVersionRequired reason:

    A service’s API is a contract with customers and is represented by using the api-version query parameter. Changes such as adding an optional property to a request/response or introducing a new operation is a change to the service’s contract and therefore requires a new api-version value. This is critically important for documentation, client libraries, and customer support.

    EXAMPLE: if a customer calls a service in the public cloud using api-version=2020-07-27, the new property or operation may exist but if they call the service in a government cloud, air-gapped cloud, or Azure Stack Hub cloud using the same api-version, the property or operation may not exist. Because there is no clear relationship between the service api-version and the new property/operation, customers can’t trust the documentation and Azure customer have difficulty helping customers diagnose issues. In addition, each client library version documents the service version it supports. When an optional property or new operation is added to a service and its Swagger, new client libraries must be produced to expose this functionality to customers. Without updating the api-version, it is unclear to customers which version of a client library supports these new features.

    @john35452 john35452 added the NotReadyForReview <valid label in PR review process>It is in draft for swagger or not swagger PR label Jul 19, 2021
    @john35452 john35452 force-pushed the dev-maps-Microsoft.Maps-1.0 branch from 69baaa1 to 34f6c85 Compare July 19, 2021 12:40
    @john35452 john35452 force-pushed the dev-maps-Microsoft.Maps-1.0 branch from 34f6c85 to e9ff98e Compare July 19, 2021 12:44
    @john35452 john35452 requested a review from evaou July 20, 2021 05:53
    @john35452 john35452 requested a review from ambientlight July 20, 2021 07:31
    @ambientlight
    Copy link
    Member

    @john35452: This needs to be structured accordingly to #14871 since Weather service will be under its own client.

    @john35452
    Copy link
    Contributor Author

    @john35452: This needs to be structured accordingly to #14871 since Weather service will be under its own client.

    Thanks for the remind! Currently, this PR is used to check schema with PM for now.
    We will move files to weather client directory after #14871 is merged.

    },
    {
    "name": "duration",
    "description": "Specifies for how many days from now we would like to know about the air quality. Available values are 1 ~ 4.",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Per below AccuWeather API doc, the available time spans are 1, 2, 3, 4, 5, 6, and 7 days.
    http://apidev.accuweather.com/developers/airQualityAPIParameters#queryParameters

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Thanks for the remind!
    It's kind of surprising that our current implementation only allows 1 to 4 which we also need to take care of in the near future.
    https://msazure.visualstudio.com/One/_git/Azure-IoT-LocationBasedServices?path=%2Fsrc%2FALSProxy%2FALS%2FModels%2FWeather%2FDailyForecastAirQualityRequest.cs&_a=contents&version=GBmaster

    },
    "/weather/airQuality/forecast/daily/{format}": {
    "get": {
    "description": "**Get Daily Air Quality Forecast**\n\n**Applies to**: S1 pricing tiers.\n\nThe service provides the detailed information about the concentration of pollutant and overall status for upcoming few days air quality. The service can provide forecast air quality for future one to four days.",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    To follow existing naming convention, we could update the API title from "Get Daily Air Quality Forecast" to "Get Air Quality Daily Forecast".

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Updated

    },
    "/weather/airQuality/forecast/hourly/{format}": {
    "get": {
    "description": "**Get Hourly Air Quality forecast**\n\n**Applies to**: S1 pricing tiers.\n\nThe service provides the detailed information about the concentration of pollutant and overall status for current air quality.",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    To follow existing naming convention, we could update the API title from "Get Hourly Air Quality Forecast" to "Get Air Quality Hourly Forecast".

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Updated

    "Pollutants": {
    "name": "Pollutants",
    "in": "query",
    "type": "string",
    Copy link
    Member

    @ambientlight ambientlight Jul 22, 2021

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    @john35452: the description mentions this is boolean?

    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    it'll work either way as our web server will translate the string value to boolean when we hydrate the request query object but swagger does support a boolean type so we can use that as well. See if we have any other API that has a boolean and if we use type = string or boolean. As i said it'll work either way at the service level so atleast we can be consistent

    Copy link
    Member

    @ambientlight ambientlight Jul 22, 2021

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    booleans are way better for generated clients It feels like

    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    @sataneja: I think we should update others to bool too in another PR for consistency.

    I mean, generated code is like:

    alertsResp, err := weatherClient.GetSevereWeatherAlerts(ctx, weather.ResponseFormatJSON, "48.057,-81.091", &weather.WeatherGetSevereWeatherAlertsOptions{
       Details:  to.StringPtr("true"),
       Language: to.StringPtr("EN"),
    })

    Having string parameters for bools is weird from clients perspective. Generated bools are better:

    currentAirQualityResp, err := weatherClient.GetCurrentAirQuality(ctx, weather.ResponseFormatJSON, "47.632346,-122.138874", &weather.WeatherGetCurrentAirQualityOptions{
        Language:   to.StringPtr("EN"),
        Pollutants: to.BoolPtr(true),
    })

    {
    "name": "duration",
    "description": "Specifies for how many days from now we would like to know about the air quality. Available values are 1, 2, 3, 4, 5, 6, and 7.",
    "default": 1,
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    We should mention that the default value is 1 in the description itself. Marking "default" property = 1 may help the SDK's but it doesn't show up in the final documentation so it's not easily visible to the user.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Thanks for the remind. I have added it on.

    @@ -76,6 +76,13 @@
    }
    },
    "parameters": {
    "Pollutants": {
    "name": "Pollutants",
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    'p'ollutants

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Updated

    "type": "integer"
    },
    {
    "$ref": "#/parameters/Pollutants"
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Just double check but i looked at the Accuweather docs and I don't think the "pollutants" query param is supported for the "daily" API. It's only supported for "hourly" and "current" API's - http://apidev.accuweather.com/developers/airQualityAPIGuide#dailyFcastv2 - It makes sense if you see the response but i wd just run the daily api in Postman to confirm and if not just remove it from the Daily API docs

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Thanks for the remind! After I try with the postman. This parameter is not supported in daily forecasat, so I remove it now.

    @openapi-workflow-bot
    Copy link

    Hi @john35452, Your PR has some issues. Please fix the CI sequentially by following the order of Avocado, semantic validation, model validation, breaking change, lintDiff.

    TaskHow to fixPrioritySupport (Microsoft alias)
    AvocadoFix-AvocadoHighruowan
    Semantic validationFix-SemanticValidation-ErrorHighraychen, jianyxi
    Model validationFix-ModelValidation-ErrorHighraychen,jianyxi
    LintDiffFix-LintDiffhighjianyxi, ruoxuan
    If you need further help, please feedback via swagger feedback."

    @evaou evaou requested a review from eriklindeman July 24, 2021 11:33
    "in": "query",
    "type": "boolean",
    "required": false,
    "description": "Boolean value that returns detailed information about each pollutant. By default is True."
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    @john35452: "x-ms-parameter-location": "method" is also needed, this is a method parameter right?

    @ambientlight
    Copy link
    Member

    ambientlight commented Jul 28, 2021

    Thanks for the remind! Currently, this PR is used to check schema with PM for now.
    We will move files to weather client directory after #14871 is merged.

    @john35452: Also keep in mind the changes introduced:

    1. Common definitions were moved into https://github.com/Azure/azure-rest-api-specs/blob/master/specification/maps/data-plane/Common/preview/1.0/common.json, so ClientId, ResponseFormat(JSONFormat) parameters in path should reference the common definitions.
    2. SubscriptionKey is not needed as explicit parameter and is rather set in securityDefinitions:
      "AzureKey": {
      "type": "apiKey",
      "description": "This is a shared key that is provisioned when creating an [Azure Maps resource](https://aka.ms/amauth) through the Azure management plane via Azure portal, PowerShell, CLI, Azure SDKs, or REST APIs.\n\n With this key, any application is authorized to access all REST APIs. In other words, these can currently be treated as master keys to the account which they are issued for.\n\n For publicly exposed applications, our recommendation is to use server-to-server access of Azure Maps REST APIs where this key can be securely stored.",
      "name": "subscription-key",
      "in": "header"
      }

    Like:
    https://github.com/ambientlight/azure-rest-api-specs/blob/f822d819ddb3f2627d576277c256e5e4405aaa2c/specification/maps/data-plane/Weather/preview/1.0/weather.json#L527-L550

    ref pr I used to test the codegen of your updates: ambientlight@f822d81#diff-434f5529f9a095a3d6a4e2520ab5b7067f710bcb75ce41788533eb6fcf0976e2

    @ambientlight
    Copy link
    Member

    @john35452: thanks, saw the #15351

    @anuchandy anuchandy changed the title [Hub Generated] Review request for Microsoft.Maps/Microsoft.Maps to add version preview/1.0 [Maps] Adding Operations for airQuality (current, forecast/daily/ and forecast/hourly) to weather swagger Aug 6, 2021
    @anuchandy
    Copy link
    Member

    @JeffreyRichter - the service is already deployed and this pr adds three 3 endpoints to swagger to align with the service.

    In an offline sync map engineer mentioned - the APIs for Azure Maps have been live for a few years, hence these changes aren't really breaking - the service APIs haven't changed, and there are no SDK released.

    @anuchandy
    Copy link
    Member

    @@JeffreyRichter could you provide the breaking change approval if there are no concerns?

    @anuchandy anuchandy removed the DoNotMerge <valid label in PR review process> use to hold merge after approval label Aug 6, 2021
    @ambientlight ambientlight added the DoNotMerge <valid label in PR review process> use to hold merge after approval label Aug 6, 2021
    @JeffreyRichter
    Copy link
    Member

    This does seem like a bunch of breaking changes. Is this matching service behavior or does the serviced want to make this change in which case it should be done in a new api-version?

    @JeffreyRichter JeffreyRichter added the Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 label Aug 6, 2021
    @JeffreyRichter
    Copy link
    Member

    I approved this because I just read your first note. But, this seems like a bunch of breaking changes pushed on to customers. Service teams shouldn't just deploy new API contract changes and then update their swagger saying that this is NOW matching service behavior in order to get approval.

    @ambientlight
    Copy link
    Member

    @anuchandy, @JeffreyRichter: this should not be merged, superseded by #15351

    @JeffreyRichter
    Copy link
    Member

    So, should I approve #15351?
    If so, I'm hesitant to because of the removed property. See https://github.com/Azure/azure-rest-api-specs/pull/15351/checks?check_run_id=3218460533

    @ambientlight
    Copy link
    Member

    ambientlight commented Aug 6, 2021

    @JeffreyRichter:

    To clarify, the removal of host parametrization is intentional (https://github.com/Azure/azure-rest-api-specs/pull/15351/files#diff-434f5529f9a095a3d6a4e2520ab5b7067f710bcb75ce41788533eb6fcf0976e2R7), as it was added by mistake previously and should not appear in map clients except creator.

    However this has been already addressed in a seperate PR: #15386, we can remove it in order not cause 1007 - RemovedClientParameter and then there should not be any other concerns to approve #15351 ?

    @john35452 john35452 closed this Aug 9, 2021
    @john35452
    Copy link
    Contributor Author

    john35452 commented Aug 9, 2021

    Since this PR is targeted at Microsoft.Map directory which is in the old directory structure, and we need to add our new change to client directory now.
    So I raise another PR for this change.
    #15351
    https://portal.azure-devex-tools.com/branch/john35452/azure-rest-api-specs/dev-maps-Weather-1.0...master/
    Thanks a lot and sorry for causing confusion!

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Approved-BreakingChange DO NOT USE! OBSOLETE label. See https://github.com/Azure/azure-sdk-tools/issues/6374 CI-FixRequiredOnFailure DoNotMerge <valid label in PR review process> use to hold merge after approval NotReadyForReview <valid label in PR review process>It is in draft for swagger or not swagger PR
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    6 participants