Giter Site home page Giter Site logo

implementations of `encoding.TextMarshaler` render as a union of the base type and string, instead of just string about jsonschema-go HOT 2 CLOSED

swaggest avatar swaggest commented on September 24, 2024
implementations of `encoding.TextMarshaler` render as a union of the base type and string, instead of just string

from jsonschema-go.

Comments (2)

vearutop avatar vearutop commented on September 24, 2024

Hi, thank you for raising this issue, I'll try to took into it soon for a proper solution, in meanwhile the workaround is to declare desired schema with type mapping:

https://github.com/swaggest/rest/blob/v0.2.61/_examples/advanced-generic-openapi31/router.go#L84-L89

	// Create custom schema mapping for 3rd party type.
	uuidDef := jsonschema.Schema{}
	uuidDef.AddType(jsonschema.String)
	uuidDef.WithFormat("uuid")
	uuidDef.WithExamples("248df4b7-aa70-47b8-a036-33ac447e668d")
	jsr.AddTypeMapping(uuid.UUID{}, uuidDef)

from jsonschema-go.

nightmarlin-dojo avatar nightmarlin-dojo commented on September 24, 2024

thanks a lot, both for looking into it and the workaround!

from jsonschema-go.

Related Issues (19)

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.