Is there a command line to merge separate swagger json specs? - swagger-2.0

I have multiple swagger.json 2.0 spec files from many different applications. Is there a way to merge them together into a single swagger.json 2.0 spec file?

Related

Is it possible to exclude paths in Openapi code generation?

We are using a large third party API with many optional features. There are 27 endpoints and we need only a few of these from Maven. We are using server side generation.
If you are interested the API is here: https://github.com/mjeffrey/psd2
Ideally we would only generate and expose the ones we support.
Is it possible to just generate a list of API endpoints or exclude ones we don't want to support?
I see there is the possibility to generate only certain models but that is not what we need. the -D apis parameter seems tor be treated as a boolean in the source code.
https://github.com/OpenAPITools/openapi-generator#3---usage
https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md#selective-generation
I'm also considering a pre-processor so we don't need to manually edit the yaml file (which is updated regularly). Any suggestions for preprocessing the yaml file?
The way to do this is to use the environment variable apis and provide a comma separated list of the root path-segment. Unfortunately in our case the root is /v1 so we get only one "api" generated and we can't select individual paths.
Stripping off the /v1 from all the paths we can then use:
Command line
java -Dapis="consents,{payment-service},accounts"
Maven
<configuration>
<environmentVariables>
<apis>consents,{payment-service},accounts</apis>
</environmentVariables>
</configuration>

ASP.NET MVC localization

I need to do localization in my ASP.NET MVC project. I need some expert advice that Should I add separate resource file for each model or I should use only one resource file for each Language and In the resource file I need to add all models keys across the project.
like I have 50 models in applications and I want localization for Frech Language so do I need to add only one resource file having keys for all 50 models or should i add separate resource file for each model.
Thanks
I would split file types based on function.
E.g : Have one file for all the display names , another one for all the validation errors.
I would place the files in App_GlobalResources . The advantage with that is that you dont need a new deployment for changes to the resource file .
You can actually create a small console application which can read all your model properties using reflection and put them in a resource file using the resource editor class.

Generate only $ref in JSON.NET JsonSchemaGenerator?

I have a goal of automating converting some of my .NET model classes into Java classes. The current method I am attempting is to use JSON.NET to generate a JSON Schema and then use jsonschema2pojo to produce the Java classes. I have a .NET backend and .NET, Android, and iOS clients. This particular piece is for the Android client to consume JSON RESTful resources from the .NET server.
My specific question is:
Is there a way to have JSON.NET's JsonSchemaGenerator not recurse into nested classes but instead to always specify a $ref? I'm not seeing any options for JsonSchemaGenerator and the JsonProperty attribute doesn't seem to contain anything that would help. I would like to have a schema file for each class and no duplicate definitions of a class when it's nested within another class. jsonschema2pojo seems to work well with a directory full of schema files with each file having the name of the class.

Merging BizTalk binding files

I am using BizTalk Deployment Framework (BTDF) for deploying my BizTalk solution. If I have made any changes to BizTalk bindings, I export them from BizTalk Administration Console and replace my PortBindingsMaster.xml bindings file (created by BTDF) with my exported bindings. I think many of you do the same. The problem is that when I do the export, BizTalk mixes up the order of XML nodes in bindings file, so when I am trying to merge with my source control, I'm getting over 9000 conflicts.
Is there any cool way to merge these BizTalk bindings?
Too much trouble trying to merge these. Get comfortable with the structure of a binding file and extract the parent node you need and copy it over to PortBindingsMaster.
The other problem with merging is if you use settingsfilegenerator, you'll need to merge that which can be potentially everywhere in PortBindingsMaster.
There's a coolway by using NotePad++ Pretty XML plugin. Apply pretty xml to both Binding Files.

Why most symfony2 thirdpary bundles use xml some yml and very few annotations for configuration?

Is it just for separation of concerns?
Is there any other advantage? Do you know of any bundles that use annotations instead?
Another thing to note is that symfony-standard uses yaml by default; This is also true for the cookbook.
This applies to symfony1 but probably nothing has changed. Source.
What's the best Format for your Service Definitions?
Using the XML format gives you several advantages over the YAML one:
When a XML file is loaded, it is automatically validated with the
built-in services.xsd file;
The XML can be auto-completed in IDEs;
The XML format is faster than the YAML one;
The XML format as no external dependencies (the YAML format relies on
the sfYAML component).

Resources