Coder Social home page Coder Social logo

Comments (6)

kailuowang avatar kailuowang commented on May 12, 2024

@prithvi23 currently it's using reflection to get the fields. It doesn't support using a custom Reads or Writes. If you think about it, to use a custom reads and writes, you will need to provide not only the reads/writes and also an instance of the class, which will probably be more complex to write than just writing the schema in the swagger.yml.
For the error case you provided, did the generation fails with a runtime exception or doe it just fail to provide a valid schema?

from play-swagger.

prithvi23 avatar prithvi23 commented on May 12, 2024

Can the Formats be used as an implicit?

[NoSuchElementException: None.get]
This is the error that I get at the time of generation.

Its failing at line number 19

def specs = cached("swaggerDef") {
18 Action.async { _ =>
19 Future.fromTry(generator.generate()).map(Ok(_))
20 }
21

from play-swagger.

prithvi23 avatar prithvi23 commented on May 12, 2024

Also Just would like to thank you for a good utility and a prompt response. :)

from play-swagger.

kailuowang avatar kailuowang commented on May 12, 2024

Looks like you are trying to encode an ADT, that is basically an enum. play-swagger doesn't support generating swagger doc for this type of data yet, (although it shouldn't throw a runtime exception). The best work around again is to write your schema definition in swagger.yml yourself ( don't $ref your Consumer class)

from play-swagger.

prithvi23 avatar prithvi23 commented on May 12, 2024

That would be nice - can you point me to a sample Swagger.yml file that overrides the definitions?
I also would need to generate custom definitions like List of consumer objects as Consumers etc...

from play-swagger.

kailuowang avatar kailuowang commented on May 12, 2024

you should be able to find plenty here.
http://editor.swagger.io/#/

from play-swagger.

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.