Resolve all $refs in JSON Schema - jsonschema

I want to resolve all $refs in my JSON Schema. But internal and external. Which tool provide such functionality?

tv4 allows you to resolve internal and external refs.
You have to add manually each intended external reference as it is explained here. If an external ref has not been added, you can find it in tv4.missing.
The python json-schema validator also allows you to resolve external references if you use it with the reference module included.
You can review the rest of implementations if you need a resolver in any other programming language.

Related

Creating Custom compound Type in Hippo CMS10 and using it inside document

I have Created Compound type Profile under go-green project of hippo community version. I have created compound-type inside go-green document types. This compound type has 5 fields via Name, Title, Designation, Description and Image. I wanna know how to render this compound type in the document where I am using this compound type. I have written my bean class for this compound type, but unable to render it inside document.
Any help on this is appreciated.
Thanks in advance.
The bean and the template need to be tied together. There is a third component which is the java Component class which needs to load the document on to the request. Though, if extending an existing document it probably is already put on the request. Then you can use the bean in your template like any other java bean.
Some of our tutorials may help. They start here[1].
[1] https://www.onehippo.org/trails/deep-dive/hello-world.html
--edit--
I should've read more carefully.
You shouldn't create a bean for a compound but for a document. This bean already exists for the document types in the project. If you are using essentials you can use the Bean Writer tool. Otherwise you will need to create the bean for the whole document. This still needs to be put on the request by a component of course. The class itself should be in your site war. It will be found as long as it is on the class path.

Replacement Implementation for Provider Model in ASP.NET 5

I have existing code that uses System.Configuration.Provider namespace for provider collections to plugin various implementations of interfaces, where multiple implementations exist in the collection and are selected by name according to various logic.
This namespace is not available in .net core, so I'm looking for advice on how to implement a replacement solution that will work with .net core framework.
I know that if I was just trying to plugin one implementation, I could do it by dependency injection. But I'm looking for a way to have multiple implementations available to choose based on name.
My current implementation with provider model populates the provider collection from a folder where you can drop in xml files that declare the type of the actual implementations, so new implementations of the provider can be loaded from an assembly by just adding another file to the folder. I'd like to keep the logic as similar as possible to that but I'm open to json files rather than xml.
I am thinking I could load up a collection of implementations of the interface from json files in Startup and use dependency injection to provide the collection where needed or perhaps an interface that can get the collection would be lighter weight and allow getting them when they are needed rather than at startup.
Is that the right approach? Anyone have better ideas or done something similar?
This is done more generically than using an abstract base class like ProviderBase in the new framework. You can register multiple of the same service with the DI framework and get them all either simply by asking for an IEnumerable<> of the type you register them as or using the GetRequiredServices<> extension method. Once you get your services, however, you'll need some other way of distinguishing them, such as a property indicating a unique name, which is the pattern the ASP.Net team has been following.
You can see an example in the Identity framework v3 with the Token Providers.
IUserTokenProvider<T>, the "provider"
UserManager, which consumes the token managers

What is the use of service.method attribute in Moqui?

I am not able to figure out the method in which I can use the service.method attribute in Moqui. Is this similar to that of service.invoke attribute in OFBIz which allows me to call the method form the file specified in the location.
I was not able to find any examples related to this anywhere in the code.
The annotation in the XSD for the service.#method attribute says: "The method within the location, if applicable to the service type."
To expand on that, for Java classes this is the method within the class. For Groovy scripts you can call a method in the script (or Groovy class) instead of running the top-level of the script.

Ninject provider can't resolve types registered within a named scope

I am using the NamedScoped Ninject extension in an attempt to create object graphs that are constructed everytime a command handler is constructed by the container. In other words, I want a fresh object graph for every command that might get processed by its corresponding handler.
I have used the .DefinesNamedScope("TopLevelOrhcestrator") binding when registering my "command handlers" as they are the top level for command processing.
A type in this named scope needs to be injected with the result of a method call on a type already registered in this named scope. I thought the best way to do this would be with a ninject provider.
Inside the provider I attempt to resolve the type in hopes I can call a method on it to pass into another object I am creating within this named scope. The problem I'm having is that when I ask the IContext for the instance inside the customer provider I get an exception that says "No matching scopes are available, and the type is declared InNamedScope(TopLevelOrchestrator).
context.Kernel.Get<TypeAlreadyRegisteredInScope>().MethodThatGetsAnotherDependency()
Is it possible to get types from the container inside a Ninject provider when they are registered inside a named scope?
EDIT
I apologize if the use case seems a bit odd, I am experimenting with some ideas about how to manage my units of work and other services/managers that may need a handle to the uow to complete a business usecase. I know its common for the unit of work to be "started" and then passed into all dependencies that may need to take part in a larger process. I was thinking I'd rather let my orchestrator take a unit of work factory so that it could deterministically destroy the UOW and it would be clear who the owner of a usecase is. What would get supplied to the managers/services would be a proxy to the unit of work that would be null until a real unit of work was started by the orchestrator. That's why I was attempting to link the proxy from the already registered type in my provider. This is all very experimental at this point and was testing some ideas.
I'd be happy to hear any further thoughts.
For MethodThatGetsAnotherDependency() to be able to .Get<>() an instance that is bound .InNamedScope(...) you will need to add the Context Preservation Extension.
This is because NamedScope is adding a parameter to the request context of the binding that has .DefinesNamedScope(...). As soon as that request is over, that context and it's parameters are forgotten. Now with the ContextPreservation extension the context is kept and reused for late / factory creations (Func<>, interface factory with .ToFactory() binding...). It think it should also work with providers.
If not, just switch to a factory instead of a provider.
However i have to admit that i don't fully understand why/what you are trying to achieve. There might be simpler ways.

How do I add a SOAP template from XSD in soapUI when XML extension is in place?

I need to make a large number of SOAP test cases to automate the testing process of an application.
Currently, the architecture requires that a single "generic" SOAP method is invoked with an object of a generic type. Each "real" operation is defined by an element in the generic object and requires an object of an extended type to be used as input.
When I create the request template with soapUI, I only get the generic object elements, but I would like to add the empty template for a specific XSD type that is defined in my current schema to be used.
If I use xsi:type then soapUI correctly says that my markup is not valid against the schema (missing required elements), but I can't manage to get a ready-to-fill XML template.
Can you help me?
Example
genericRequest is made of
<genericRequest>
<methodName>specificMethodName</methodName>
<authenticationID>ABCDEF</authenticationID>
</genericRequest>
sumReuqest (extending genericRequest) for a "sum" operation is made of
<sumRequest>
<methodName>specificMethodName</methodName>
<authenticationID>ABCDEF</authenticationID>
<addend>5</addend>
<addend>3</addend>
</sumRequest>
I would ultimately like soapUI to fill a SOAP template with empty addend item (of course I work with lots of elements, and they are structured too!!)
In this case you need to create two resources in soaupUI one for generic request and other for operation request, I know right now its pain to create each resource for each operation, but soapUI is developed like that or if you think any of the parameters listed : http://www.soapui.org/REST-Testing/understanding-rest-parameters.html could help, you could define parameters as one of the above.
you could try using QUERY or MATRIX style parameters in your resource.