Mapping $ref in Swagger YAML - jackson

Is there a swagger parser from YAML to java Map that includes mapping of the $ref value from Definitions?

Related

Generate Kotlin classes from wsdl file using maven

I would like to generate Kotlin classes from a given wsdl file. How can I do this using a maven plugin like jaxb2-maven-plugin or cxf-codegen-plugin?
Thanks in advance!

Missing XML comments when generating swagger via Swashbuckle CLI tool

I am using Swashbuckle V4.0.0 with Asp.Net Core 2.2. I am using XML comments to document my Swagger. When I get the swagger via the HTTP endpoints it all works great. When I run dotnet swagger tofile I get the swagger but no XML comments included. Has anyone else had XML comments work via the CLI tool?
I have looked at the Swashbuckle CLI code and I am not sure how it calls my startup code when it create the builder. I have included my code for how I tell Swashbuckle which files to use. This code is in Startup.ConfigureServices. I have XML files in my main project and a couple of library projects so I wrote a function to go find them. This function returns valid files and works perfectly when requesting swagger from http. I am at loss for what I am doing wrong.
var xmlFiles = GetXmlFiles(apiName);
services.AddSwaggerGen(
options =>
{
// add a custom operation filter which sets default values
options.OperationFilter<SwaggerDefaultValues>();
// integrate xml comments
foreach (string s in xmlFiles)
{
options.IncludeXmlComments(s);
}
});

Functional Test Package Naming Conventions?

When Functional testing Mule xml configurations, what is the best practice/conventions for naming test packages?
If testing standard Java, usually I use the same package name as the code under test i.e:
src/main/java
com.mycomapany.MyClass
src/test/java
com.mycompany.MyClassTest
But with mule xml files they are always just in src/main/app
i.e src/main/app/MyMuleFlow.xml
And tests are in src/test/java
So there is no simple correlation. What are the standard conventions for this?
As for the code location, you can add: custom source code in src/main/java and custom resources in src/main/resources.
i.e. Mule projects follow the standard Maven project layout, with the addition of src/main/app for Mule configuration files. Therefore you shouldn't feel any difference from your standard Java projects.
As for the package names, there's absolutely no constraint for Mule: do whatever you do in your standard Java projects.

How to mock a repository using data from xml file?

how to mock a repository with Mockito using data from xml file? I'd like to keep spring out of it if it's possible.

Where to include jaxb.properties file?

I have REST (Jersey) webservice that makes use of some data objects that are marshalled/unmarshalled to/from XML. The data objects are in a separate project/jar that the webservice war depends on.
I'm using MOXy as my JAXB implementation since I'm deploying to Glassfish and that's already included. I know I need a jaxb.properties file to set the JAXB implementation to MOXy with this entry:
javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
The question is, should the jaxb.properties file be included in the data object jar or in the webservice war or both?
If you don't want or can not use the jaxb.properties (you have a lot of package, the model is in a external jar, you want only java and no configuration files...), you can directly specify the JaxbContextFactory :
Do not create the context using :
JAXBContext jaxbContext = JAXBContext.newInstance(new Class[]{Person.class, ObjectFactory.class}, properties);
But instead, specify the factory to use :
JAXBContext jaxbContext = JAXBContextFactory.createContext(new Class[]{Person.class, ObjectFactory.class}, properties);
where the factory is :
import org.eclipse.persistence.jaxb.JAXBContextFactory;
It is exactly the same, but it is specified explicitly in the java code instead of implicitly in a configuration file.
You package the jaxb.properties file with your model classes. GlassFish does not include the MOXy bundle yet, but you can add it easily. Check out my blog for more info:
http://bdoughan.blogspot.com/2010/08/creating-restful-web-service-part-35.html