Skip to content

Stack overflow bug fixed when one of the properties type is Type in response model #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

ekaradev
Copy link
Contributor

@ekaradev ekaradev commented Jun 15, 2021

When response model in has a Type property this package throw an stack overflow exception because of visitors always trigger OpenApiSchemaAcceptor

For example model class

/// <summary>
    /// This represents the model entity for pet of Swagger Pet Store.
    /// </summary>
    public class Pet
    {
        /// <summary>
        /// Gets or sets the pet ID.
        /// </summary>
        public long? Id { get; set; }

        /// <summary>
        /// Gets or sets the category.
        /// </summary>
        public Category Category { get; set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        [JsonRequired]
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the list of photo URLs.
        /// </summary>
        [JsonRequired]
        public List<string> PhotoUrls { get; set; } = new List<string>();

        /// <summary>
        /// Gets or sets the list of tags.
        /// </summary>
        public List<Tag> Tags { get; set; }

        [JsonIgnore]
        /// <summary>
        /// Gets or sets the <see cref="PetStatus"/> value.
        /// </summary>
        /// 
        public PetStatus? Status { get; set; }

        // Stack Overflow exception 
        public Type StackOverflow { get; set; }

    }

@ghost
Copy link

ghost commented Jun 15, 2021

CLA assistant check
All CLA requirements met.

@ekaradev ekaradev changed the title Stack overflow bug fixed because of property type is Type Stack overflow bug fixes because of property type is Type Jun 15, 2021
@ekaradev ekaradev changed the title Stack overflow bug fixes because of property type is Type Stack overflow bug fixed when one of the properties in response model type is Type Jun 15, 2021
@ekaradev ekaradev changed the title Stack overflow bug fixed when one of the properties in response model type is Type Stack overflow bug fixed when one of the properties type is Type in response model Jun 15, 2021
Copy link
Contributor

@justinyoo justinyoo left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I've left a comment, which is a minor fix. Once I get that updated, I'll merge it.

@justinyoo justinyoo added bug Something isn't working enhancement New feature or request v0.8.0 labels Jun 16, 2021
This was linked to issues Jun 16, 2021
@justinyoo justinyoo merged commit 9d70dd9 into Azure:main Jun 16, 2021
@sebb3 sebb3 mentioned this pull request Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StackOverflow Exception on circular reference Stack overflow.
2 participants