C# stub for recruitment API


#1

Do you guys have a C# stub for the recruitment API? RAMGen is crashing when I try and use with http://talentappstore.github.io/tas-tenant-apis/raml/recruitment.raml. Driving me nuts.

Mike.


#2

Hey Mike, sorry we don’t have any specific resources for C#. If it’s the sheer size of the RAML causing the problems them perhaps you could trim it down to just the APIs that you need?

Also the RAML includes other files to do it’s thing, e.g the schemas and the examples, is it possible the path separators do not work on Windows?


#3

RamlGen was getting a stack overflow error, so it could be to do with size - or potentially something self referential in the RAML.

Anyway I have edited recruitment.raml to only include the API’s I’m interested in, and RamlGen no longer crashes.

Still not generating all of the model classes. Will keep you posted.


#4

Getting this error:

“Unable to parse the following Schemas. Please note that JSON Schema version 4 is not supported”

I notice that your schemas are marked with “$schema”: “http://json-schema.org/draft-04/schema#

Is there anything in V4 your are specifically relying on? Maybe I could edit my version down to V3.


#5

Yes, we do use a few V4 features, specifically some of:

  • anyOf (match at least one schema in the schema array),
  • allOf (match all schemas in the schema array),
  • oneOf (match exactly one schema in the schema array),

#6

Ended up coding the model classes manually. I think to fully understand the issues I would need to download and build https://github.com/mulesoft-labs/raml-dotnet-tools/tree/master/MuleSoft.RAMLGen


#7

Hello @MikeH

did you find solution to generate the models using the MuleSoft.RAML.Gen? I am also not able to generate it.

Thanks
Girish


#8

I’ve generated classes from the tas schemas using NJsonScgema https://github.com/bgorven/tsnt/tree/master/pocos/tenant. It took a little bit of pre-processing to get the schemas in a format that the tool could understand. The classes are tested by deserializing each of the examples in the spec to the appropriate type, then serializing, and confirming that no data got lost.

There is a bug that affects items (from itemRead.json and itemWrite.json), where an incorrect “type” string is output when converting them back to json; I have submitted a fix https://github.com/RSuter/NJsonSchema/pull/628.


#9

Thanks Buddy! I appreciate the effort.


#10

No worries. I hope it helps :slight_smile: