Azure / apiops

APIOps applies the concepts of GitOps and DevOps to API deployment. By using practices from these two methodologies, APIOps can enable everyone involved in the lifecycle of API design, development, and deployment with self-service and automated tools to ensure the quality of the specifications and APIs that they’re building.
https://azure.github.io/apiops
MIT License
275 stars 162 forks source link

[BUG] Publisher adding characters when API specification contains ° or ³ #556

Open jonathdb93 opened 1 month ago

jonathdb93 commented 1 month ago

Release version

APIOps Toolkit for Azure APIM v5.1.4

Describe the bug

When publishing an API specification that contains ° or ³, the final result of our schema definitions contains °C instead of °C and ³ instead of ³.

Our specification.yaml file contains the following lines:

components:
  schemas:
    Conditions:
      type: object
      properties:
        temperature:
          type: number
          description: Temperature (°C)
        gasContent:
          type: number
          description: Content of gas (mg/Nm³)
      description: Conditions

which results in a definition in APIM with schema:

{
    "type": "object",
    "properties": {
        "temperature": {
            "type": "number",
            "description": "Temperature (°C)"
        },
        "gasContent": {
            "type": "number",
            "description": "Content of gas (mg/Nm³)"
        }
    },
    "description": "Conditions"
}

Expected behavior

When providing a specification that contains ° or ³, the schema published in API Management contains ° and ³ without any additional characters.

Actual behavior

When providing a specification that contains ° or ³, the schema published in API Management contains ° and ³.

Reproduction Steps

Publish an API specification with a schema that contains a special character such as ° or 3.

github-actions[bot] commented 1 month ago
  Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
  Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.
guythetechie commented 2 weeks ago

@jonathdb93 - if you import your specification file manually into APIM through the Azure portal, does it work as expected?

jonathdb93 commented 2 weeks ago

@jonathdb93 - if you import your specification file manually into APIM through the Azure portal, does it work as expected?

@guythetechie I've manually imported the extracted file back into APIM and did not get any special characters in my API definition. This indeed works as expected.