I've got a number of extensions which I add locally to a base resource type. I do that using the technique described at http://hapifhir.io/doc_extensions.html under the heading Custom Resource Types.
For the server code and client code this is pretty convenient, because my extensions can be dealt with using nicely named accessor methods etc. My HAPI annotated classes are in a separate library that both server and client can use.
However is there a way to have the HAPI FHIR Server generate a StructureDefinition based on a class similar to the one defined at http://hapifhir.io/doc_extensions.html under the heading Custom Resource Types? I'd rather not create a StructureDefinition resource and the HAPI annotated class and have to keep them in sync, I'd rather just manage the HAPI annotated class and generate the StructureDefinition from that...if possible.
What I'm hoping for is for it to generate a StructureDefinition the same as the base resource plus the extensions with the specified cardinalities in the @Child annotation. Does something like this exist?