-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property System.String String is not included in the context #8
Comments
Yes, indeed, my fault it's missing from the readme. Each model needs a JSON-LD
Finally, you don't have to create the context from scratch. There are some helper classes. |
Ha ha. Yeah. That explains it. I'll give that a try tomorrow when I'm back at my work computer. |
Working now. Thanks! I've taken a to-do note to create a PR for updating the docs. I appreciate all your help and I'm more than happy to contribute some fixes. Just for fun I slapped the Nancy.Swagger package in there, so now I can have Swagger or Hydra docs. Looking into the |
Great. Any help will be much appreciated. Please note that I'm close to completing the #6 PR which introduces some new features and changes the library structure. I think maybe I'll make it happen over the weekend.
Definitely a possibility although personally I'm not to keen on declarative way for operations. The important difference between Swagger et. al. and Hydra/hypermedia I usually emphasize is that hypermedia controls (both links and operations) are more dynamic in nature. With Nancy it's trivial to inject something into |
A more important feature for me would be support for inline operations. Haven't figured out how to do it yet. I was considering a similar approach that Dan Barua's Nancy.Hal has that the API is kind external to the model itself. On the other hand Hydra models shouldn't be mixed with other layers so maybe it's not a problem |
I hold off on a PR for documentation updates until you push #6 so I have a chance to review them for any further changes from the PR. I haven't had much time to play with the Nancy.Swagger.Annotations, but I was hoping they would be responsive to the user permissions (but, I suspect not). It didn't occur to me to try injecting into I still think the declarative approach has merit, it would just need to be able to adapt dynamically. I had sort of assumed that the documentation plugins would just use the route cache to figure out the available operations. Apparently I was wrong :) Certainly not the first time, and won't be the last. One of the things I'm trying to avoid is having to manually keep the documentation in sync with changes to controllers. It's one more task for a developer to forget. |
Ah yes, that's what I'm attempting to address but from the other end. Instead of keeping docs in sync with controllers, I want to reverse that relation. Similar to ServiceStack where the route is associated with a Request model. Something like [Identifier("/some/resource/{id}")]
public class MyModel
{
}
public class MyModule : ArgolisModule
{
public MyModule()
{
Get<MyModel>(o => new MyModel(o.id));
Post<MyModel>(o => this.Process(this.Bind<MyModel>());
}
} This way you only define the route once. There are also utilities for getting identifiers from these templates (must be RFC syntax, not Nancy syntax) IUriTemplateExpander expander;
Uri id = expander.Expand<MyModel>(new { id = 10 }); // /some/resource/10 |
So... is Otherwise, I'm in agreement with the only define things once and I'm not fussy about which end it's done from. There are compelling arguments for doing it from the documentation end as you're suggesting. |
Nice! I'll check that out after you've finished the PR. I've got some Serilog sink work I've been neglecting, so that should keep me busy in the meantime. |
I've got things wired up with Autofac now, and I'm getting the
Link
in the header, but when I try to view the docs I'm getting:Hydra.Discovery.SupportedProperties.ApiDocumentationException: Property System.String String is not included in the context
I've got a single class registered with the
SupportedClass
attribute, and the first property throws that exception. When I step into the code, it appears that theDefaultPropertyIdProvider
is getting aContextProvider
of typeNullContextProvider
which appears to be hard-coded to returnnull
.Clearly I'm missing a vital step or two in configuring my components.
The text was updated successfully, but these errors were encountered: