Skip to content

ID is not a valid property #48

Closed
Closed

Description

@mifriis

When uploading a spec with ID as a field in message the Reader throws an exception:

{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "Bad Request",
  "status": 400,
  "detail": "Attempting to parse AsyncAPI file resulted in error 'id is not a valid property at #/components/schemas/themeDto, schema must be a map/object [#/components/schemas/themeDto/additionalProperties], Cannot create a scalar value from this type of node. [#/components/schemas/themeDto/properties/description/type], Cannot create a scalar value from this type of node. [#/components/schemas/themeDto/properties/parentThemeId/type], id is not a valid property at #/components/schemas/themeColorsDto, schema must be a map/object [#/components/schemas/themeColorsDto/additionalProperties], id is not a valid property at #/components/schemas/colorDto, schema must be a map/object [#/components/schemas/colorDto/additionalProperties], id is not a valid property at #/components/schemas/themeIconDto, schema must be a map/object [#/components/schemas/themeIconDto/additionalProperties], Cannot create a scalar value from this type of node. [#/components/schemas/themeIconDto/properties/themeLogoUrl/type], Cannot create a scalar value from this type of node. [#/components/schemas/themeIconDto/properties/signatureCharacterUrl/type], Cannot create a scalar value from this type of node. [#/components/schemas/themeIconDto/properties/altText/type], id is not a valid property at #/components/schemas/imageDto, schema must be a map/object [#/components/schemas/imageDto/additionalProperties], id is not a valid property at #/components/schemas/parentImagesDto, schema must be a map/object [#/components/schemas/parentImagesDto/additionalProperties], id is not a valid property at #/components/schemas/characterDto, schema must be a map/object [#/components/schemas/characterDto/additionalProperties], id is not a valid property at #/components/schemas/channelDto, schema must be a map/object [#/components/schemas/channelDto/additionalProperties], id is not a valid property at #/components/schemas/audienceDto, schema must be a map/object [#/components/schemas/audienceDto/additionalProperties]'",
  "traceId": "00-a22aa3f13d10a6e120298e343f385e17-62742295c4a30c42-00"
}

Error received through AMMA, but stems from AsyncAPI.NET

The spec is valid according to AsyncAPI Studio:

image

The spec:

{
    "asyncapi": "2.3.0",
    "info": {
        "x-application-id": "APP-00881",
        "x-audience": "company-internal",
        "x-skip-infrastructure": false,
        "title": "Mifriis-test-CatalogEventAPI",
        "version": "1.0.0",
        "description": "API for subscribing to changes in the Catalog. The Catalog is a variety of editorial content.",
        "contact": {
            "name": "Content Publishing Platform",
            "url": "https://teams.microsoft.com/l/channel/19%3a2dd4ddc220714cb09df23ff8fca99229%40thread.tacv2/General?groupId=6ea24e60-1f97-4b85-acac-6408ac51248f&tenantId=1d063515-6cad-4195-9486-ea65df456faa",
            "email": "49ad63d3.o365.corp.LEGO.com@emea.teams.ms"
        }
    },
    "defaultContentType": "application/json",
    "channels": {
        "ThemeChangedV1": {
            "x-eventarchetype": "objectchanged",
            "x-classification": "green",
            "x-datalakesubscription": true,
            "x-eventdurability": "persistent",
            "x-eventdeduplication": true,
            "publish": {
                "operationId": "ThemeChanged",
                "summary": "Theme changes",
                "description": "Themes published, unpublished or deleted.",
                "message": {
                    "$ref": "#/components/messages/ThemeV1"
                }
            }
        },
        "CharacterChangedV1": {
            "x-eventarchetype": "objectchanged",
            "x-classification": "green",
            "x-datalakesubscription": true,
            "x-eventdurability": "persistent",
            "x-eventdeduplication": true,
            "publish": {
                "operationId": "CharacterChanged",
                "summary": "Character changes",
                "description": "Characters published, unpublished or deleted.",
                "message": {
                    "$ref": "#/components/messages/CharacterV1"
                }
            }
        }
    },
    "components": {
        "schemas": {
            "themeDto": {
                "id": "themeDto",
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "Unique id for the specific translations"
                    },
                    "title": {
                        "type": "string",
                        "description": "Display title of the theme"
                    },
                    "description": {
                        "type": [
                            "null",
                            "string"
                        ],
                        "description": "Richtext description"
                    },
                    "colors": {
                        "description": "Theme colors",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/themeColorsDto"
                            }
                        ]
                    },
                    "icon": {
                        "description": "Theme icon",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/themeIconDto"
                            }
                        ]
                    },
                    "logo": {
                        "description": "Theme Logo",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/imageDto"
                            }
                        ]
                    },
                    "bannerStandard": {
                        "description": "Banner standard",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/imageDto"
                            }
                        ]
                    },
                    "bannerWide": {
                        "description": "Benner wide",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/imageDto"
                            }
                        ]
                    },
                    "parentThemeId": {
                        "type": [
                            "null",
                            "string"
                        ],
                        "description": "For sub-themes this property will contain the Id of the parent theme"
                    },
                    "parentImages": {
                        "description": "Images only available on parent themes",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/parentImagesDto"
                            }
                        ]
                    },
                    "invariantId": {
                        "type": "string",
                        "description": "Unique id across translations",
                        "format": "guid"
                    },
                    "contentLocale": {
                        "type": "string",
                        "description": "Localized language"
                    },
                    "marketLocale": {
                        "type": "string",
                        "description": "Published market"
                    },
                    "version": {
                        "type": "integer",
                        "description": "Published version",
                        "format": "int32"
                    },
                    "publishedAt": {
                        "type": "string",
                        "description": "Published at",
                        "format": "date-time"
                    }
                }
            },
            "themeColorsDto": {
                "id": "themeColorsDto",
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "primary": {
                        "description": "Primary theme color",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/colorDto"
                            }
                        ]
                    },
                    "secondary": {
                        "description": "Secondary theme color",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/colorDto"
                            }
                        ]
                    },
                    "accentLight": {
                        "description": "Accent light color",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/colorDto"
                            }
                        ]
                    },
                    "accentDark": {
                        "description": "Accent dark color",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/colorDto"
                            }
                        ]
                    }
                }
            },
            "colorDto": {
                "id": "colorDto",
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "red": {
                        "type": "integer",
                        "format": "int32"
                    },
                    "green": {
                        "type": "integer",
                        "format": "int32"
                    },
                    "blue": {
                        "type": "integer",
                        "format": "int32"
                    }
                }
            },
            "themeIconDto": {
                "id": "themeIconDto",
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "themeLogoUrl": {
                        "type": [
                            "null",
                            "string"
                        ],
                        "description": "Theme logo",
                        "format": "uri"
                    },
                    "signatureCharacterUrl": {
                        "type": [
                            "null",
                            "string"
                        ],
                        "description": "Signature character",
                        "format": "uri"
                    },
                    "altText": {
                        "type": [
                            "null",
                            "string"
                        ],
                        "description": "Alternate text for the icon"
                    }
                }
            },
            "imageDto": {
                "id": "imageDto",
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "url": {
                        "type": "string",
                        "description": "Absolute url to image",
                        "format": "uri"
                    },
                    "altText": {
                        "type": "string",
                        "description": "Image alternate text"
                    }
                }
            },
            "parentImagesDto": {
                "id": "parentImagesDto",
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "logoPortrait": {
                        "description": "Logo portrait image",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/imageDto"
                            }
                        ]
                    },
                    "background": {
                        "description": "Background image",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/imageDto"
                            }
                        ]
                    },
                    "border": {
                        "description": "Border image",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/imageDto"
                            }
                        ]
                    },
                    "banner": {
                        "description": "Banner image",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/imageDto"
                            }
                        ]
                    },
                    "button": {
                        "description": "Button image",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/imageDto"
                            }
                        ]
                    },
                    "playlist": {
                        "description": "Playlist image",
                        "oneOf": [
                            {
                                "type": "null"
                            },
                            {
                                "$ref": "#/components/schemas/imageDto"
                            }
                        ]
                    }
                }
            },
            "characterDto": {
                "id": "characterDto",
                "type": "object",
                "description": "A person in a product or movie. Typically related to a mini-fig.",
                "additionalProperties": false,
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "descriptionKids": {
                        "type": "string"
                    },
                    "descriptionGrownups": {
                        "type": "string"
                    },
                    "mugshot": {
                        "$ref": "#/components/schemas/imageDto"
                    },
                    "landscapePose": {
                        "$ref": "#/components/schemas/imageDto"
                    },
                    "squareFullBody": {
                        "$ref": "#/components/schemas/imageDto"
                    },
                    "threeDSpin": {
                        "$ref": "#/components/schemas/imageDto"
                    },
                    "themes": {
                        "type": "array",
                        "description": "List of themes IDs",
                        "items": {
                            "type": "string"
                        }
                    },
                    "channels": {
                        "type": "array",
                        "description": "List of target channels names",
                        "items": {
                            "$ref": "#/components/schemas/channelDto"
                        }
                    },
                    "audiences": {
                        "type": "array",
                        "description": "List of target audiences names",
                        "items": {
                            "$ref": "#/components/schemas/audienceDto"
                        }
                    },
                    "animationVideoId": {
                        "type": "string",
                        "description": "Id of the video animations of this character"
                    },
                    "id": {
                        "type": "string",
                        "description": "Unique id for the specific translations"
                    },
                    "invariantId": {
                        "type": "string",
                        "description": "Unique id across translations",
                        "format": "guid"
                    },
                    "contentLocale": {
                        "type": "string",
                        "description": "Localized language"
                    },
                    "marketLocale": {
                        "type": "string",
                        "description": "Published market"
                    },
                    "version": {
                        "type": "integer",
                        "description": "Published version",
                        "format": "int32"
                    },
                    "publishedAt": {
                        "type": "string",
                        "description": "Published at",
                        "format": "date-time"
                    }
                }
            },
            "channelDto": {
                "id": "channelDto",
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    }
                }
            },
            "audienceDto": {
                "id": "audienceDto",
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    }
                }
            }
        },
        "messages": {
            "ThemeV1": {
                "payload": {
                    "$ref": "#/components/schemas/themeDto"
                },
                "name": "ThemeV1",
                "title": "Theme V1",
                "summary": "Marked specific theme",
                "description": "A theme data object containing title, description, colors and images. A theme is translated to a variaty of languages."
            },
            "CharacterV1": {
                "payload": {
                    "$ref": "#/components/schemas/characterDto"
                },
                "name": "CharacterV1",
                "title": "Character V1",
                "summary": "Marked specific character",
                "description": "A character data object containing title, description and images. The character is translated to a variaty of languages."
            }
        }
    },
    "externalDocs": {
        "description": "Product handbook",
        "url": "https://platform.pages.git42.corp.lego.com/handbook/docs/products/catalog/"
    }
}

Activity

  1. mifriis commented on Jul 5, 2022

    @mifriis
    ContributorAuthor

    @davidkaae FYI, this will be a breaker for you until fixed.

    I have fixed up the spec for you in different ways though, bumped version to 2.3.0, moved deduplication down to channels and added required extension fields. This spec should let you set it up when this bug is fixed.

  2. davidkaae commented on Jul 5, 2022

    @davidkaae

    Thank you @mifriis
    FYI: This documentation https://github.com/LEGO/api-management-management-api/wiki/AsyncAPI#x-eventdeduplication still explain like deduplication is part of info.

    I would also like to know a bit more about x-datalakesubscription (more documentation in the wiki). Like what is happening behind the scenes. It has an exciting name :D

  3. VisualBean commented on Jul 5, 2022

    @VisualBean
    Contributor

    Hi @davidkaae
    It is complaining about all of the "id" properties in your schemas.

     "channelDto": {
                    "id": "channelDto", # this one!
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "title": {
                            "type": "string"
                        }
                    }
                },

    We dont support this specific property of the JSON Schema standard - we generally support the ones listed here https://www.asyncapi.com/docs/reference/specification/v2.3.0#schemaObject

    But the "id" properties you have are also not correct according to the specification (it should be $id (after draft-4)).
    In the specification $id is used as an (either uri or relative uri) reference pointer that can be used for 2 things

    1. identifying a specific schema or subschema
    2. setting a base url that $ref is resolved against. (we also dont support external refs).

    In the above example it should have been
    "$id" : "/schemas/channelDto" to be according to spec.

    $id and $ref go hand in hand as $ref, technically references $id. - the way our logic is implemented however is by the name key of the DTO itself and not the $id property (in the same way OpenAPI.Net does things)

    $id has quite a few different semantics as to how it works, depending on which type of uri (relative/absolute) and how its used. which makes if "iffy".

    Do you need the $id property?

    Also AdditionalProperties is not a boolean according to the Json Core specification.

    The value of "additionalProperties" MUST be a valid JSON Schema.
    https://json-schema.org/draft/2020-12/json-schema-core.html#section-10.3.2.3-1

    TLDR;
    We dont support $id and probably won't, also your additionalProperties property, should not be a boolean, but rather a map of additionalProperties.

  4. davidkaae commented on Jul 5, 2022

    @davidkaae

    The async api document is autogenerated with Saunter.
    I will see if I can get the $id property removed.

  5. VisualBean commented on Jul 5, 2022

    @VisualBean
    Contributor

    The async api document is autogenerated with Saunter. I will see if I can get the $id property removed.

    Just to clarify, it is not the "id" property of your models, but rather the "id" property of the schemas that hold the models. if that makes sense.,

  6. davidkaae commented on Jul 5, 2022

    @davidkaae

    Yes, I get it :)
    But it is still the:
    Saunter.Generation.DocumentGenerator and Saunter.Serialization.NewtonsoftAsyncApiDocumentSerializer that generates it.
    So I will have to "fikumdik" something with the serialization.

  7. VisualBean commented on Jul 5, 2022

    @VisualBean
    Contributor

    Its very interesting that it does this, as its not actually part of the supported json specification draft 😅
    Perhaps raising a bug would be needful as well.
    Should i put something together?

  8. VisualBean commented on Jul 5, 2022

    @VisualBean
    Contributor

    The problem seems to be related to Saunter using NJsonSchema, which is a lib for deserializing JsonSchema (draft-4). Which is technically not the supported one in AsyncApi 😅

  9. mifriis commented on Jul 5, 2022

    @mifriis
    ContributorAuthor

    Some more work, arrays of types isn't supported (not sure if it should be?)

    I get this error now:

    {
      "type": "https://httpstatuses.com/400",
      "title": "Bad Request",
      "status": 400,
      "detail": "This Scope value is not allowed. (Parameter 'value')"
    }
    

    The spec:

    {
        "asyncapi": "2.3.0",
        "info": {
            "x-application-id": "APP-00881",
            "x-audience": "company-internal",
            "x-skip-infrastructure": false,
            "title": "Mifriis-test-CatalogEventAPI",
            "version": "1.0.0",
            "description": "API for subscribing to changes in the Catalog. The Catalog is a variety of editorial content.",
            "contact": {
                "name": "Content Publishing Platform",
                "url": "https://teams.microsoft.com/l/channel/19%3a2dd4ddc220714cb09df23ff8fca99229%40thread.tacv2/General?groupId=6ea24e60-1f97-4b85-acac-6408ac51248f&tenantId=1d063515-6cad-4195-9486-ea65df456faa",
                "email": "49ad63d3.o365.corp.LEGO.com@emea.teams.ms"
            }
        },
        "defaultContentType": "application/json",
        "channels": {
            "ThemeChangedV1": {
                "x-eventarchetype": "objectchanged",
                "x-classification": "green",
                "x-datalakesubscription": true,
                "x-eventdurability": "persistent",
                "x-eventdeduplication": true,
                "publish": {
                    "operationId": "ThemeChanged",
                    "summary": "Theme changes",
                    "description": "Themes published, unpublished or deleted.",
                    "message": {
                        "$ref": "#/components/messages/ThemeV1"
                    }
                }
            },
            "CharacterChangedV1": {
                "x-eventarchetype": "objectchanged",
                "x-classification": "green",
                "x-datalakesubscription": true,
                "x-eventdurability": "persistent",
                "x-eventdeduplication": true,
                "publish": {
                    "operationId": "CharacterChanged",
                    "summary": "Character changes",
                    "description": "Characters published, unpublished or deleted.",
                    "message": {
                        "$ref": "#/components/messages/CharacterV1"
                    }
                }
            }
        },
        "components": {
            "schemas": {
                "themeDto": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string",
                            "description": "Unique id for the specific translations"
                        },
                        "title": {
                            "type": "string",
                            "description": "Display title of the theme"
                        },
                        "description": {
                            "type": "string",
                            "description": "Richtext description"
                        },
                        "colors": {
                            "description": "Theme colors",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/themeColorsDto"
                                }
                            ]
                        },
                        "icon": {
                            "description": "Theme icon",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/themeIconDto"
                                }
                            ]
                        },
                        "logo": {
                            "description": "Theme Logo",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/imageDto"
                                }
                            ]
                        },
                        "bannerStandard": {
                            "description": "Banner standard",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/imageDto"
                                }
                            ]
                        },
                        "bannerWide": {
                            "description": "Benner wide",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/imageDto"
                                }
                            ]
                        },
                        "parentThemeId": {
                            "type": "string",
                            "description": "For sub-themes this property will contain the Id of the parent theme"
                        },
                        "parentImages": {
                            "description": "Images only available on parent themes",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/parentImagesDto"
                                }
                            ]
                        },
                        "invariantId": {
                            "type": "string",
                            "description": "Unique id across translations",
                            "format": "guid"
                        },
                        "contentLocale": {
                            "type": "string",
                            "description": "Localized language"
                        },
                        "marketLocale": {
                            "type": "string",
                            "description": "Published market"
                        },
                        "version": {
                            "type": "integer",
                            "description": "Published version",
                            "format": "int32"
                        },
                        "publishedAt": {
                            "type": "string",
                            "description": "Published at",
                            "format": "date-time"
                        }
                    }
                },
                "themeColorsDto": {
                    "type": "object",
                    "properties": {
                        "primary": {
                            "description": "Primary theme color",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/colorDto"
                                }
                            ]
                        },
                        "secondary": {
                            "description": "Secondary theme color",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/colorDto"
                                }
                            ]
                        },
                        "accentLight": {
                            "description": "Accent light color",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/colorDto"
                                }
                            ]
                        },
                        "accentDark": {
                            "description": "Accent dark color",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/colorDto"
                                }
                            ]
                        }
                    }
                },
                "colorDto": {
                    "type": "object",
                    "properties": {
                        "red": {
                            "type": "integer",
                            "format": "int32"
                        },
                        "green": {
                            "type": "integer",
                            "format": "int32"
                        },
                        "blue": {
                            "type": "integer",
                            "format": "int32"
                        }
                    }
                },
                "themeIconDto": {
                    "type": "object",
                    "properties": {
                        "themeLogoUrl": {
                            "type": "string",
                            "description": "Theme logo",
                            "format": "uri"
                        },
                        "signatureCharacterUrl": {
                            "type": "string",
                            "description": "Signature character",
                            "format": "uri"
                        },
                        "altText": {
                            "type": "string",
                            "description": "Alternate text for the icon"
                        }
                    }
                },
                "imageDto": {
                    "type": "object",
                    "properties": {
                        "url": {
                            "type": "string",
                            "description": "Absolute url to image",
                            "format": "uri"
                        },
                        "altText": {
                            "type": "string",
                            "description": "Image alternate text"
                        }
                    }
                },
                "parentImagesDto": {
                    "type": "object",
                    "properties": {
                        "logoPortrait": {
                            "description": "Logo portrait image",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/imageDto"
                                }
                            ]
                        },
                        "background": {
                            "description": "Background image",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/imageDto"
                                }
                            ]
                        },
                        "border": {
                            "description": "Border image",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/imageDto"
                                }
                            ]
                        },
                        "banner": {
                            "description": "Banner image",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/imageDto"
                                }
                            ]
                        },
                        "button": {
                            "description": "Button image",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/imageDto"
                                }
                            ]
                        },
                        "playlist": {
                            "description": "Playlist image",
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "$ref": "#/components/schemas/imageDto"
                                }
                            ]
                        }
                    }
                },
                "characterDto": {
                    "type": "object",
                    "description": "A person in a product or movie. Typically related to a mini-fig.",
                    "properties": {
                        "name": {
                            "type": "string"
                        },
                        "descriptionKids": {
                            "type": "string"
                        },
                        "descriptionGrownups": {
                            "type": "string"
                        },
                        "mugshot": {
                            "$ref": "#/components/schemas/imageDto"
                        },
                        "landscapePose": {
                            "$ref": "#/components/schemas/imageDto"
                        },
                        "squareFullBody": {
                            "$ref": "#/components/schemas/imageDto"
                        },
                        "threeDSpin": {
                            "$ref": "#/components/schemas/imageDto"
                        },
                        "themes": {
                            "type": "array",
                            "description": "List of themes IDs",
                            "items": {
                                "type": "string"
                            }
                        },
                        "channels": {
                            "type": "array",
                            "description": "List of target channels names",
                            "items": {
                                "$ref": "#/components/schemas/channelDto"
                            }
                        },
                        "audiences": {
                            "type": "array",
                            "description": "List of target audiences names",
                            "items": {
                                "$ref": "#/components/schemas/audienceDto"
                            }
                        },
                        "animationVideoId": {
                            "type": "string",
                            "description": "Id of the video animations of this character"
                        },
                        "id": {
                            "type": "string",
                            "description": "Unique id for the specific translations"
                        },
                        "invariantId": {
                            "type": "string",
                            "description": "Unique id across translations",
                            "format": "guid"
                        },
                        "contentLocale": {
                            "type": "string",
                            "description": "Localized language"
                        },
                        "marketLocale": {
                            "type": "string",
                            "description": "Published market"
                        },
                        "version": {
                            "type": "integer",
                            "description": "Published version",
                            "format": "int32"
                        },
                        "publishedAt": {
                            "type": "string",
                            "description": "Published at",
                            "format": "date-time"
                        }
                    }
                },
                "channelDto": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "title": {
                            "type": "string"
                        }
                    }
                },
                "audienceDto": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "title": {
                            "type": "string"
                        }
                    }
                }
            },
            "messages": {
                "ThemeV1": {
                    "payload": {
                        "$ref": "#/components/schemas/themeDto"
                    },
                    "name": "ThemeV1",
                    "title": "Theme V1",
                    "summary": "Marked specific theme",
                    "description": "A theme data object containing title, description, colors and images. A theme is translated to a variaty of languages."
                },
                "CharacterV1": {
                    "payload": {
                        "$ref": "#/components/schemas/characterDto"
                    },
                    "name": "CharacterV1",
                    "title": "Character V1",
                    "summary": "Marked specific character",
                    "description": "A character data object containing title, description and images. The character is translated to a variaty of languages."
                }
            }
        },
        "externalDocs": {
            "description": "Product handbook",
            "url": "https://platform.pages.git42.corp.lego.com/handbook/docs/products/catalog/"
        }
    }
    
  10. davidkaae commented on Jul 5, 2022

    @davidkaae

    With some fikumdik the following schema is not generated from my side.
    The [ "null", "string" ] type was from "string?" properties in my DTO. I have not removed the ? and written the "Can be null" comment instead. There might be other properties that should get that description, but for now those that complained is changed.
    image
    Same for "Uri?" that was also generating the type [ "null", "string" ]. Now changed to this.
    image

    It is not pretty, but I can now generate the schema with the x-* properties in channels like this. Luckily for me (for now at least) all channels have the same properties.
    image

    Current schema

    {
      "asyncapi": "2.3.0",
      "info": {
        "x-application-id": "APP-00881",
        "x-audience": "company-internal",
        "x-skip-infrastructure": false,
        "title": "CatalogEventAPI",
        "version": "1.0.0",
        "description": "API for subscribing to changes in the Catalog. The Catalog is a variaty of editorial content.",
        "contact": {
          "name": "Content Publishing Platform",
          "url": "https://teams.microsoft.com/l/channel/19%3a2dd4ddc220714cb09df23ff8fca99229%40thread.tacv2/General?groupId=6ea24e60-1f97-4b85-acac-6408ac51248f&tenantId=1d063515-6cad-4195-9486-ea65df456faa",
          "email": "49ad63d3.o365.corp.LEGO.com@emea.teams.ms"
        }
      },
      "servers": {
        "integration": {
          "url": "events.prod.async.api.legogroup.io:6651",
          "protocol": "pulsar+ssl"
        },
        "prod": {
          "url": "events.prod.async.api.legogroup.io:6651",
          "protocol": "pulsar+ssl"
        }
      },
      "defaultContentType": "application/json",
      "channels": {
        "ThemeChangedV1": {
          "x-eventdeduplication": true,
          "x-eventarchtype": "objectchanged",
          "x-classification": "green",
          "x-eventdurability": "persistent",
          "x-datalakesubscription": true,
          "publish": {
            "operationId": "ThemeChanged",
            "summary": "Theme changes",
            "description": "Themes published, unpublished or deleted.",
            "message": null
          }
        },
        "CharacterChangedV1": {
          "x-eventdeduplication": true,
          "x-eventarchtype": "objectchanged",
          "x-classification": "green",
          "x-eventdurability": "persistent",
          "x-datalakesubscription": true,
          "publish": {
            "operationId": "CharacterChanged",
            "summary": "Character changes",
            "description": "Characters published, unpublished or deleted.",
            "message": null
          }
        }
      },
      "components": {
        "schemas": {
          "themeDto": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique id for the specific translations"
              },
              "title": {
                "type": "string",
                "description": "Display title of the theme"
              },
              "description": {
                "type": "string",
                "description": "Richtext description. Can be null."
              },
              "colors": {
                "description": "Theme colors",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/themeColorsDto" }
                ]
              },
              "icon": {
                "description": "Theme icon",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/themeIconDto" }
                ]
              },
              "logo": {
                "description": "Theme Logo",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "bannerStandard": {
                "description": "Banner standard",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "bannerWide": {
                "description": "Benner wide",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "parentThemeId": {
                "type": "string",
                "description": "For sub-themes this property will contain the Id of the parent theme. Can be null."
              },
              "parentImages": {
                "description": "Images only available on parent themes",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/parentImagesDto" }
                ]
              },
              "invariantId": {
                "type": "string",
                "description": "Unique id across translations",
                "format": "guid"
              },
              "contentLocale": {
                "type": "string",
                "description": "Localized language"
              },
              "marketLocale": {
                "type": "string",
                "description": "Published market"
              },
              "version": {
                "type": "integer",
                "description": "Published version",
                "format": "int32"
              },
              "publishedAt": {
                "type": "string",
                "description": "Published at",
                "format": "date-time"
              }
            }
          },
          "themeColorsDto": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "primary": {
                "description": "Primary theme color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              },
              "secondary": {
                "description": "Secondary theme color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              },
              "accentLight": {
                "description": "Accent light color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              },
              "accentDark": {
                "description": "Accent dark color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              }
            }
          },
          "colorDto": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "red": {
                "type": "integer",
                "format": "int32"
              },
              "green": {
                "type": "integer",
                "format": "int32"
              },
              "blue": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          "themeIconDto": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "themeLogoUrl": {
                "type": "string",
                "description": "Theme logo. Can be null.",
                "format": "uri"
              },
              "signatureCharacterUrl": {
                "type": "string",
                "description": "Signature character. Can be null.",
                "format": "uri"
              },
              "altText": {
                "type": "string",
                "description": "Alternate text for the icon. Can be null."
              }
            }
          },
          "imageDto": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "url": {
                "type": "string",
                "description": "Absolute url to image",
                "format": "uri"
              },
              "altText": {
                "type": "string",
                "description": "Image alternate text"
              }
            }
          },
          "parentImagesDto": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "logoPortrait": {
                "description": "Logo portrait image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "background": {
                "description": "Background image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "border": {
                "description": "Border image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "banner": {
                "description": "Banner image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "button": {
                "description": "Button image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "playlist": {
                "description": "Playlist image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              }
            }
          },
          "characterDto": {
            "type": "object",
            "description": "A person in a product or movie. Typically related to a mini-fig.",
            "additionalProperties": false,
            "properties": {
              "name": { "type": "string" },
              "descriptionKids": { "type": "string" },
              "descriptionGrownups": { "type": "string" },
              "mugshot": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "landscapePose": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "squareFullBody": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "threeDSpin": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "themes": {
                "type": "array",
                "description": "List of themes IDs",
                "items": { "type": "string" }
              },
              "channels": {
                "type": "array",
                "description": "List of target channels names",
                "items": { "$ref": "#/components/schemas/channelDto" }
              },
              "audiences": {
                "type": "array",
                "description": "List of target audiences names",
                "items": { "$ref": "#/components/schemas/audienceDto" }
              },
              "animationVideoId": {
                "type": "string",
                "description": "Id of the video animations of this character"
              },
              "id": {
                "type": "string",
                "description": "Unique id for the specific translations"
              },
              "invariantId": {
                "type": "string",
                "description": "Unique id across translations",
                "format": "guid"
              },
              "contentLocale": {
                "type": "string",
                "description": "Localized language"
              },
              "marketLocale": {
                "type": "string",
                "description": "Published market"
              },
              "version": {
                "type": "integer",
                "description": "Published version",
                "format": "int32"
              },
              "publishedAt": {
                "type": "string",
                "description": "Published at",
                "format": "date-time"
              }
            }
          },
          "channelDto": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": { "type": "string" },
              "title": { "type": "string" }
            }
          },
          "audienceDto": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": { "type": "string" },
              "title": { "type": "string" }
            }
          }
        },
        "messages": {
          "ThemeV1": {
            "payload": { "$ref": "#/components/schemas/themeDto" },
            "name": "ThemeV1",
            "title": "Theme V1",
            "summary": "Marked specific theme",
            "description": "A theme data object containing title, description, colors and images. A theme is translated to a variaty of languages."
          },
          "CharacterV1": {
            "payload": { "$ref": "#/components/schemas/characterDto" },
            "name": "CharacterV1",
            "title": "Character V1",
            "summary": "Marked specific character",
            "description": "A character data object containing title, description and images. The character is translated to a variaty of languages."
          }
        }
      },
      "externalDocs": {
        "description": "Product handbook",
        "url": "https://platform.pages.git42.corp.lego.com/handbook/docs/products/catalog/"
      }
    }
  11. mifriis commented on Jul 5, 2022

    @mifriis
    ContributorAuthor

    Looks good @davidkaae

    I havn't tested it yet, but AMMA on integration is ready (we think!) you can try uploading it there: https://panel.integration.amma.api.legogroup.io/docs/index.html

    AMMA prod should also be (we are secretly live).

    I am chasing down an issue where the specs aren't going through to Baseplate at the moment. Maybe we can work on a "how to setup saunter" together with you and the team after summer? for those that wish to generate instead of spec first

  12. davidkaae commented on Jul 5, 2022

    @davidkaae

    Just tried, and I have some errors in my serialization. You don't have to test. I will fix my stuff and test again.

  13. davidkaae commented on Jul 5, 2022

    @davidkaae

    Ok, my schema is not failing on validation anymore. Now it fails on this:
    image
    I am able to call other endpoints like [Get] .../me/workspaces.
    Correlation id in text: 8565b564-9c1b-4284-8bd1-a2c0d72ae6ee

  14. mifriis commented on Jul 5, 2022

    @mifriis
    ContributorAuthor

    Maybe running it locally can aid here. I'm off on vacation and can't do it. (i get the same error with this spec: #48 (comment))

    For whoever picks it up:

    • Run AsyncAPI.NET locally and run Davids spec through an integraiton test, see what happens
    • Or, run AMMA locally and set a breakpoint in ApisController on line 144ish
  15. VisualBean commented on Jul 5, 2022

    @VisualBean
    Contributor

    Ok, my schema is not failing on validation anymore. Now it fails on this:

    image

    I am able to call other endpoints like [Get] .../me/workspaces.

    Correlation id in text: 8565b564-9c1b-4284-8bd1-a2c0d72ae6ee

    This is a yamldotnet argument exception i believe. (Which triggers some specific pathing for us, why you get the exception message. Ill figure out the underlying issue tomorrow 🙂

  16. VisualBean commented on Jul 6, 2022

    @VisualBean
    Contributor

    Type can be an array as well... this is sorted in this PR #49

  17. VisualBean commented on Jul 6, 2022

    @VisualBean
    Contributor

    @davidkaae
    It is complaining about 2 things

    1. "message": null - nulls should not be propagated to the specification (i wonder why it does this)
    2. AdditionalProperties is supposed to be a map, just like properties is. not a boolean. (this is a bug on the Saunter side, as he uses NJsonSchema, which validates a draft 04 JsonSchema. AsyncAPI uses a draft 07 JsonSchema, which referes to https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#page-14 where additionalProperties is a map.

    image

    asyncapi/saunter#138

  18. davidkaae commented on Jul 6, 2022

    @davidkaae

    @VisualBean yes I know that. That was the issues I was writing about above. I fixed those with this schema and got the "This scope value is not allowed" issue instead.

    Hare are the updated schema, sorry for not posting that as well:

    {
      "asyncapi": "2.3.0",
      "info": {
        "x-application-id": "APP-00881",
        "x-audience": "company-internal",
        "x-skip-infrastructure": false,
        "title": "CatalogEventAPI",
        "version": "1.0.0",
        "description": "API for subscribing to changes in the Catalog. The Catalog is a variaty of editorial content.",
        "contact": {
          "name": "Content Publishing Platform",
          "url": "https://teams.microsoft.com/l/channel/19%3a2dd4ddc220714cb09df23ff8fca99229%40thread.tacv2/General?groupId=6ea24e60-1f97-4b85-acac-6408ac51248f&tenantId=1d063515-6cad-4195-9486-ea65df456faa",
          "email": "49ad63d3.o365.corp.LEGO.com@emea.teams.ms"
        }
      },
      "defaultContentType": "application/json",
      "channels": {
        "ThemeChangedV1": {
          "x-eventdeduplication": true,
          "x-eventarchetype": "objectchanged",
          "x-classification": "green",
          "x-eventdurability": "persistent",
          "x-datalakesubscription": true,
          "publish": {
            "operationId": "ThemeChanged",
            "summary": "Theme changes",
            "description": "Themes published, unpublished or deleted.",
            "message": { "$ref": "#/components/messages/ThemeV1" }
          }
        },
        "CharacterChangedV1": {
          "x-eventdeduplication": true,
          "x-eventarchetype": "objectchanged",
          "x-classification": "green",
          "x-eventdurability": "persistent",
          "x-datalakesubscription": true,
          "publish": {
            "operationId": "CharacterChanged",
            "summary": "Character changes",
            "description": "Characters published, unpublished or deleted.",
            "message": { "$ref": "#/components/messages/CharacterV1" }
          }
        }
      },
      "components": {
        "schemas": {
          "themeDto": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique id for the specific translations"
              },
              "title": {
                "type": "string",
                "description": "Display title of the theme"
              },
              "description": {
                "type": "string",
                "description": "Richtext description. Can be null."
              },
              "colors": {
                "description": "Theme colors",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/themeColorsDto" }
                ]
              },
              "icon": {
                "description": "Theme icon",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/themeIconDto" }
                ]
              },
              "logo": {
                "description": "Theme Logo",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "bannerStandard": {
                "description": "Banner standard",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "bannerWide": {
                "description": "Benner wide",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "parentThemeId": {
                "type": "string",
                "description": "For sub-themes this property will contain the Id of the parent theme. Can be null."
              },
              "parentImages": {
                "description": "Images only available on parent themes",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/parentImagesDto" }
                ]
              },
              "invariantId": {
                "type": "string",
                "description": "Unique id across translations",
                "format": "guid"
              },
              "contentLocale": {
                "type": "string",
                "description": "Localized language"
              },
              "marketLocale": {
                "type": "string",
                "description": "Published market"
              },
              "version": {
                "type": "integer",
                "description": "Published version",
                "format": "int32"
              },
              "publishedAt": {
                "type": "string",
                "description": "Published at",
                "format": "date-time"
              }
            }
          },
          "themeColorsDto": {
            "type": "object",
            "properties": {
              "primary": {
                "description": "Primary theme color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              },
              "secondary": {
                "description": "Secondary theme color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              },
              "accentLight": {
                "description": "Accent light color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              },
              "accentDark": {
                "description": "Accent dark color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              }
            }
          },
          "colorDto": {
            "type": "object",
            "properties": {
              "red": {
                "type": "integer",
                "format": "int32"
              },
              "green": {
                "type": "integer",
                "format": "int32"
              },
              "blue": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          "themeIconDto": {
            "type": "object",
            "properties": {
              "themeLogoUrl": {
                "type": "string",
                "description": "Theme logo. Can be null.",
                "format": "uri"
              },
              "signatureCharacterUrl": {
                "type": "string",
                "description": "Signature character. Can be null.",
                "format": "uri"
              },
              "altText": {
                "type": "string",
                "description": "Alternate text for the icon. Can be null."
              }
            }
          },
          "imageDto": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "description": "Absolute url to image",
                "format": "uri"
              },
              "altText": {
                "type": "string",
                "description": "Image alternate text"
              }
            }
          },
          "parentImagesDto": {
            "type": "object",
            "properties": {
              "logoPortrait": {
                "description": "Logo portrait image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "background": {
                "description": "Background image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "border": {
                "description": "Border image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "banner": {
                "description": "Banner image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "button": {
                "description": "Button image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "playlist": {
                "description": "Playlist image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              }
            }
          },
          "characterDto": {
            "type": "object",
            "description": "A person in a product or movie. Typically related to a mini-fig.",
            "properties": {
              "name": { "type": "string" },
              "descriptionKids": { "type": "string" },
              "descriptionGrownups": { "type": "string" },
              "mugshot": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "landscapePose": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "squareFullBody": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "threeDSpin": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "themes": {
                "type": "array",
                "description": "List of themes IDs",
                "items": { "type": "string" }
              },
              "channels": {
                "type": "array",
                "description": "List of target channels names",
                "items": { "$ref": "#/components/schemas/channelDto" }
              },
              "audiences": {
                "type": "array",
                "description": "List of target audiences names",
                "items": { "$ref": "#/components/schemas/audienceDto" }
              },
              "animationVideoId": {
                "type": "string",
                "description": "Id of the video animations of this character"
              },
              "id": {
                "type": "string",
                "description": "Unique id for the specific translations"
              },
              "invariantId": {
                "type": "string",
                "description": "Unique id across translations",
                "format": "guid"
              },
              "contentLocale": {
                "type": "string",
                "description": "Localized language"
              },
              "marketLocale": {
                "type": "string",
                "description": "Published market"
              },
              "version": {
                "type": "integer",
                "description": "Published version",
                "format": "int32"
              },
              "publishedAt": {
                "type": "string",
                "description": "Published at",
                "format": "date-time"
              }
            }
          },
          "channelDto": {
            "type": "object",
            "properties": {
              "id": { "type": "string" },
              "title": { "type": "string" }
            }
          },
          "audienceDto": {
            "type": "object",
            "properties": {
              "id": { "type": "string" },
              "title": { "type": "string" }
            }
          }
        },
        "messages": {
          "ThemeV1": {
            "payload": { "$ref": "#/components/schemas/themeDto" },
            "name": "ThemeV1",
            "title": "Theme V1",
            "summary": "Marked specific theme",
            "description": "A theme data object containing title, description, colors and images. A theme is translated to a variaty of languages."
          },
          "CharacterV1": {
            "payload": { "$ref": "#/components/schemas/characterDto" },
            "name": "CharacterV1",
            "title": "Character V1",
            "summary": "Marked specific character",
            "description": "A character data object containing title, description and images. The character is translated to a variaty of languages."
          }
        }
      },
      "externalDocs": {
        "description": "Product handbook",
        "url": "https://platform.pages.git42.corp.lego.com/handbook/docs/products/catalog/"
      }
    }
  19. VisualBean commented on Jul 6, 2022

    @VisualBean
    Contributor

    @VisualBean yes I know that. That was the issues I was writing about above. I fixed those with this schema and got the "This scope value is not allowed" issue instead.

    Hare are the updated schema, sorry for not posting that as well:

    {
      "asyncapi": "2.3.0",
      "info": {
        "x-application-id": "APP-00881",
        "x-audience": "company-internal",
        "x-skip-infrastructure": false,
        "title": "CatalogEventAPI",
        "version": "1.0.0",
        "description": "API for subscribing to changes in the Catalog. The Catalog is a variaty of editorial content.",
        "contact": {
          "name": "Content Publishing Platform",
          "url": "https://teams.microsoft.com/l/channel/19%3a2dd4ddc220714cb09df23ff8fca99229%40thread.tacv2/General?groupId=6ea24e60-1f97-4b85-acac-6408ac51248f&tenantId=1d063515-6cad-4195-9486-ea65df456faa",
          "email": "49ad63d3.o365.corp.LEGO.com@emea.teams.ms"
        }
      },
      "defaultContentType": "application/json",
      "channels": {
        "ThemeChangedV1": {
          "x-eventdeduplication": true,
          "x-eventarchetype": "objectchanged",
          "x-classification": "green",
          "x-eventdurability": "persistent",
          "x-datalakesubscription": true,
          "publish": {
            "operationId": "ThemeChanged",
            "summary": "Theme changes",
            "description": "Themes published, unpublished or deleted.",
            "message": { "$ref": "#/components/messages/ThemeV1" }
          }
        },
        "CharacterChangedV1": {
          "x-eventdeduplication": true,
          "x-eventarchetype": "objectchanged",
          "x-classification": "green",
          "x-eventdurability": "persistent",
          "x-datalakesubscription": true,
          "publish": {
            "operationId": "CharacterChanged",
            "summary": "Character changes",
            "description": "Characters published, unpublished or deleted.",
            "message": { "$ref": "#/components/messages/CharacterV1" }
          }
        }
      },
      "components": {
        "schemas": {
          "themeDto": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique id for the specific translations"
              },
              "title": {
                "type": "string",
                "description": "Display title of the theme"
              },
              "description": {
                "type": "string",
                "description": "Richtext description. Can be null."
              },
              "colors": {
                "description": "Theme colors",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/themeColorsDto" }
                ]
              },
              "icon": {
                "description": "Theme icon",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/themeIconDto" }
                ]
              },
              "logo": {
                "description": "Theme Logo",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "bannerStandard": {
                "description": "Banner standard",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "bannerWide": {
                "description": "Benner wide",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "parentThemeId": {
                "type": "string",
                "description": "For sub-themes this property will contain the Id of the parent theme. Can be null."
              },
              "parentImages": {
                "description": "Images only available on parent themes",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/parentImagesDto" }
                ]
              },
              "invariantId": {
                "type": "string",
                "description": "Unique id across translations",
                "format": "guid"
              },
              "contentLocale": {
                "type": "string",
                "description": "Localized language"
              },
              "marketLocale": {
                "type": "string",
                "description": "Published market"
              },
              "version": {
                "type": "integer",
                "description": "Published version",
                "format": "int32"
              },
              "publishedAt": {
                "type": "string",
                "description": "Published at",
                "format": "date-time"
              }
            }
          },
          "themeColorsDto": {
            "type": "object",
            "properties": {
              "primary": {
                "description": "Primary theme color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              },
              "secondary": {
                "description": "Secondary theme color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              },
              "accentLight": {
                "description": "Accent light color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              },
              "accentDark": {
                "description": "Accent dark color",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/colorDto" }
                ]
              }
            }
          },
          "colorDto": {
            "type": "object",
            "properties": {
              "red": {
                "type": "integer",
                "format": "int32"
              },
              "green": {
                "type": "integer",
                "format": "int32"
              },
              "blue": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          "themeIconDto": {
            "type": "object",
            "properties": {
              "themeLogoUrl": {
                "type": "string",
                "description": "Theme logo. Can be null.",
                "format": "uri"
              },
              "signatureCharacterUrl": {
                "type": "string",
                "description": "Signature character. Can be null.",
                "format": "uri"
              },
              "altText": {
                "type": "string",
                "description": "Alternate text for the icon. Can be null."
              }
            }
          },
          "imageDto": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "description": "Absolute url to image",
                "format": "uri"
              },
              "altText": {
                "type": "string",
                "description": "Image alternate text"
              }
            }
          },
          "parentImagesDto": {
            "type": "object",
            "properties": {
              "logoPortrait": {
                "description": "Logo portrait image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "background": {
                "description": "Background image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "border": {
                "description": "Border image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "banner": {
                "description": "Banner image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "button": {
                "description": "Button image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "playlist": {
                "description": "Playlist image",
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              }
            }
          },
          "characterDto": {
            "type": "object",
            "description": "A person in a product or movie. Typically related to a mini-fig.",
            "properties": {
              "name": { "type": "string" },
              "descriptionKids": { "type": "string" },
              "descriptionGrownups": { "type": "string" },
              "mugshot": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "landscapePose": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "squareFullBody": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "threeDSpin": {
                "oneOf": [
                  { "type": "null" },
                  { "$ref": "#/components/schemas/imageDto" }
                ]
              },
              "themes": {
                "type": "array",
                "description": "List of themes IDs",
                "items": { "type": "string" }
              },
              "channels": {
                "type": "array",
                "description": "List of target channels names",
                "items": { "$ref": "#/components/schemas/channelDto" }
              },
              "audiences": {
                "type": "array",
                "description": "List of target audiences names",
                "items": { "$ref": "#/components/schemas/audienceDto" }
              },
              "animationVideoId": {
                "type": "string",
                "description": "Id of the video animations of this character"
              },
              "id": {
                "type": "string",
                "description": "Unique id for the specific translations"
              },
              "invariantId": {
                "type": "string",
                "description": "Unique id across translations",
                "format": "guid"
              },
              "contentLocale": {
                "type": "string",
                "description": "Localized language"
              },
              "marketLocale": {
                "type": "string",
                "description": "Published market"
              },
              "version": {
                "type": "integer",
                "description": "Published version",
                "format": "int32"
              },
              "publishedAt": {
                "type": "string",
                "description": "Published at",
                "format": "date-time"
              }
            }
          },
          "channelDto": {
            "type": "object",
            "properties": {
              "id": { "type": "string" },
              "title": { "type": "string" }
            }
          },
          "audienceDto": {
            "type": "object",
            "properties": {
              "id": { "type": "string" },
              "title": { "type": "string" }
            }
          }
        },
        "messages": {
          "ThemeV1": {
            "payload": { "$ref": "#/components/schemas/themeDto" },
            "name": "ThemeV1",
            "title": "Theme V1",
            "summary": "Marked specific theme",
            "description": "A theme data object containing title, description, colors and images. A theme is translated to a variaty of languages."
          },
          "CharacterV1": {
            "payload": { "$ref": "#/components/schemas/characterDto" },
            "name": "CharacterV1",
            "title": "Character V1",
            "summary": "Marked specific character",
            "description": "A character data object containing title, description and images. The character is translated to a variaty of languages."
          }
        }
      },
      "externalDocs": {
        "description": "Product handbook",
        "url": "https://platform.pages.git42.corp.lego.com/handbook/docs/products/catalog/"
      }
    }

    This one gives me no errors on the current version of asyncapi.net (has not hit amma integration yet though)

  20. davidkaae commented on Jul 6, 2022

    @davidkaae

    It was in amma integration I got the issue (see screenshot with correlation id).

  21. VisualBean commented on Jul 7, 2022

    @VisualBean
    Contributor

    It was in amma integration I got the issue (see screenshot with correlation id).

    I located the bug. numbers are not currently allowed as scopes in AMMA. - it was not a yaml issue after all. Ill improve the error message and add numbers as allowed scopes.

    https://github.com/LEGO/api-management-management-api/pull/891

  22. VisualBean commented on Jul 21, 2022

    @VisualBean
    Contributor

    I believe we have fixed everything, except bindings - which is next up. otherwise please reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions