Git Product home page Git Product logo

Comments (3)

danielgtaylor avatar danielgtaylor commented on May 27, 2024 1

Oh, actually I just tried this in https://editor-next.swagger.io/ and you are right, SwaggerUI doesn't show it. Maybe we need to add it in both places for the best compatibility... 🤔

from huma.

NishadVadgama avatar NishadVadgama commented on May 27, 2024 1

Yes, right, for JSON Schema it required under schema object but it doesn't work for swaggerui though. I tested with stoplight though and it shows description. But I guess as you said, adding at both places will definitely help.

from huma.

danielgtaylor avatar danielgtaylor commented on May 27, 2024

@NishadVadgama thanks for opening the issue! This is actually allowed in JSON Schema, see https://json-schema.org/draft/2020-12/json-schema-validation#name-title-and-description:

9.1. "title" and "description"
The value of both of these keywords MUST be a string.

Both of these keywords can be used to decorate a user interface with information about the data produced by this user interface. A title will preferably be short, whereas a description will provide explanation about the purpose of the instance described by this schema.

Huma uses the schema description on purpose so that tools which use just the schema can still get description information.

Are you running into any problem with this behavior? I believe all the popular documentation generators and SDK generators will use the schema description when available. Let me know if that's not the case and we can figure out what to do about it.

from huma.

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.