Git Product home page Git Product logo

Comments (5)

AaronME avatar AaronME commented on July 26, 2024

Did some basic trouble-shooting. It looks like the schema for AutoScalingGroup includes a field for "tags" which is defined as an "array" and the items schema says it should be an array of "object" types.

However, properties field of this array is set to null, which is breaking the page at

let propKeys = Object.keys(props);

Including the relevant "tags" schema below:

"tags":
{
    "ID": "",
    "Schema": "",
    "Ref": null,
    "Description": "",
    "Type": "array",
    "Nullable": false,
    "Format": "",
    "Title": "",
    "Default": null,
    "Maximum": null,
    "ExclusiveMaximum": false,
    "Minimum": null,
    "ExclusiveMinimum": false,
    "MaxLength": null,
    "MinLength": null,
    "Pattern": "",
    "MaxItems": null,
    "MinItems": null,
    "UniqueItems": false,
    "MultipleOf": null,
    "Enum": null,
    "MaxProperties": null,
    "MinProperties": null,
    "Required": null,
    "Items":
    {
        "Schema":
        {
            "ID": "",
            "Schema": "",
            "Ref": null,
            "Description": "",
            "Type": "object",
            "Nullable": false,
            "Format": "",
            "Title": "",
            "Default": null,
            "Maximum": null,
            "ExclusiveMaximum": false,
            "Minimum": null,
            "ExclusiveMinimum": false,
            "MaxLength": null,
            "MinLength": null,
            "Pattern": "",
            "MaxItems": null,
            "MinItems": null,
            "UniqueItems": false,
            "MultipleOf": null,
            "Enum": null,
            "MaxProperties": null,
            "MinProperties": null,
            "Required": null,
            "Items": null,
            "AllOf": null,
            "OneOf": null,
            "AnyOf": null,
            "Not": null,
            "Properties": null,
            "AdditionalProperties":
            {
                "Allows": true,
                "Schema":
                {
                    "ID": "",
                    "Schema": "",
                    "Ref": null,
                    "Description": "",
                    "Type": "string",
                    "Nullable": false,
                    "Format": "",
                    "Title": "",
                    "Default": null,
                    "Maximum": null,
                    "ExclusiveMaximum": false,
                    "Minimum": null,
                    "ExclusiveMinimum": false,
                    "MaxLength": null,
                    "MinLength": null,
                    "Pattern": "",
                    "MaxItems": null,
                    "MinItems": null,
                    "UniqueItems": false,
                    "MultipleOf": null,
                    "Enum": null,
                    "MaxProperties": null,
                    "MinProperties": null,
                    "Required": null,
                    "Items": null,
                    "AllOf": null,
                    "OneOf": null,
                    "AnyOf": null,
                    "Not": null,
                    "Properties": null,
                    "AdditionalProperties": null,
                    "PatternProperties": null,
                    "Dependencies": null,
                    "AdditionalItems": null,
                    "Definitions": null,
                    "ExternalDocs": null,
                    "Example": null,
                    "XPreserveUnknownFields": null,
                    "XEmbeddedResource": false,
                    "XIntOrString": false,
                    "XListMapKeys": null,
                    "XListType": null,
                    "XMapType": null
                }
            },
            "PatternProperties": null,
            "Dependencies": null,
            "AdditionalItems": null,
            "Definitions": null,
            "ExternalDocs": null,
            "Example": null,
            "XPreserveUnknownFields": null,
            "XEmbeddedResource": false,
            "XIntOrString": false,
            "XListMapKeys": null,
            "XListType": null,
            "XMapType": null
        },
        "JSONSchemas": null
    },
    "AllOf": null,
    "OneOf": null,
    "AnyOf": null,
    "Not": null,
    "Properties": null,
    "AdditionalProperties": null,
    "PatternProperties": null,
    "Dependencies": null,
    "AdditionalItems": null,
    "Definitions": null,
    "ExternalDocs": null,
    "Example": null,
    "XPreserveUnknownFields": null,
    "XEmbeddedResource": false,
    "XIntOrString": false,
    "XListMapKeys": null,
    "XListType": null,
    "XMapType": null
},

from doc.

AaronME avatar AaronME commented on July 26, 2024

This code block assumes that all "object" types have properties:

doc/template/doc.html

Lines 95 to 109 in cb01d9f

let props = property.Properties || {};
let type = property.Type;
if (type === 'array') {
const itemsSchema = property.Items.Schema;
if (itemsSchema.Type !== 'object') {
type = `[]${itemsSchema.Type}`;
} else {
console.log({ property, itemsSchema });
schema = itemsSchema;
props = itemsSchema.Properties;
type = `[]object`;
}
}
let propKeys = Object.keys(props);

from doc.

AaronME avatar AaronME commented on July 26, 2024

@muvaf Could you confirm whether crdsdev needs to accommodate this type of schema or if this might be a bug in the generated type?

from doc.

hasheddan avatar hasheddan commented on July 26, 2024

@AaronME if the k8s api server accepts it then we should be accommodating it here 👍🏻 I'm working on some fixes

from doc.

muvaf avatar muvaf commented on July 26, 2024

@AaronME thanks for debugging! Seems like that field has the type of []map[string]*string, which might be why.

from doc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.