Jersey WADL: How do you rename generated XSDs
Asked Answered
B

2

9

The web service I am working on has the generated WADL that Jersey creates. What I want to do is rename xsd0.xsd to Result.xsd or something like that. When it regenerates the WADL every time, it will be Result.xsd. Is this possible with Jersey?

Biconvex answered 12/12, 2012 at 14:54 Comment(0)
T
4

The source code has hard-coded counter++ thing in a very private method, so you cannot change it easliy. But as I see, you could create your own wadl generator implemenation and configure with it org.glassfish.jersey.server.ServerProperties#WADL_GENERATOR_CONFIG property, then you could do custom naming code.

Tare answered 23/4, 2013 at 12:48 Comment(2)
Thanks. Where do I find some on how to configure my own implementation?Vigilant
@Vigilant Take the jersey-samples, it has extended-wadl-webapp in it. The SampleWadlGeneratorConfig could be changed to something like: return generator( MyWadlGeneratorJAXBGrammarGenerator.class ). You could create the generator class by copying the original one from the link above. When you could customise it.Tare
B
1

If you follow this and modify the application-grammars.xml file to this

<grammars xmlns="http://wadl.dev.java.net/2009/02"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:xi="http://www.w3.org/1999/XML/xinclude">
   <include href="Result.xsd" />
</grammars>

you could add another grammar, Result.xsd in your case, into the wadl but not replace the xsd0.xsd

Bywaters answered 30/4, 2013 at 5:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.