Breaking changes:
added `a_request_methods' argument to WSF_ROUTER_SELF_DOCUMENTATION_HANDLER.mapping_documentation added similar argument to WSF_ROUTER_SELF_DOCUMENTATION_ROUTER_MAPPING.documentation Renamed WSF_ROUTER_METHODS as WSF_REQUEST_METHODS Enhanced WSF_REQUEST_METHODS with new has_... function Added WSF_ROUTER_VISITOR and WSF_ROUTER_ITERATOR that may be useful to iterate inside the router. we may improve the implementation of the router using those visitors in the future. Improved the WSF_DEFAULT_RESPONSE to embedded suggested items (typically based on pseudo self documented router)
This commit is contained in:
@@ -45,7 +45,7 @@ feature {NONE} -- Initialization
|
||||
|
||||
feature -- Documentation
|
||||
|
||||
mapping_documentation (m: WSF_ROUTER_MAPPING): WSF_ROUTER_MAPPING_DOCUMENTATION
|
||||
mapping_documentation (m: WSF_ROUTER_MAPPING; a_request_methods: detachable WSF_REQUEST_METHODS): WSF_ROUTER_MAPPING_DOCUMENTATION
|
||||
do
|
||||
create Result.make (m)
|
||||
Result.set_is_hidden (is_hidden)
|
||||
@@ -54,7 +54,7 @@ feature -- Documentation
|
||||
|
||||
feature {WSF_ROUTER} -- Mapping
|
||||
|
||||
on_mapped (a_mapping: WSF_ROUTER_MAPPING; a_rqst_methods: detachable WSF_ROUTER_METHODS)
|
||||
on_mapped (a_mapping: WSF_ROUTER_MAPPING; a_rqst_methods: detachable WSF_REQUEST_METHODS)
|
||||
-- Callback called when a router map a route to Current handler
|
||||
do
|
||||
if attached {WSF_STARTS_WITH_MAPPING} a_mapping as m then
|
||||
|
||||
@@ -191,14 +191,14 @@ feature {WSF_RESPONSE} -- Output
|
||||
res.put_string (l_description)
|
||||
end
|
||||
|
||||
append_documentation_to (s: STRING_8; m: WSF_ROUTER_MAPPING; meths: detachable WSF_ROUTER_METHODS)
|
||||
append_documentation_to (s: STRING_8; m: WSF_ROUTER_MAPPING; meths: detachable WSF_REQUEST_METHODS)
|
||||
local
|
||||
l_url: detachable STRING_8
|
||||
l_base_url: detachable READABLE_STRING_8
|
||||
l_doc: detachable WSF_ROUTER_MAPPING_DOCUMENTATION
|
||||
do
|
||||
if attached {WSF_SELF_DOCUMENTED_ROUTER_MAPPING} m as l_doc_mapping then
|
||||
l_doc := l_doc_mapping.documentation
|
||||
l_doc := l_doc_mapping.documentation (meths)
|
||||
end
|
||||
if l_doc = Void or else not l_doc.is_hidden then
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ deferred class
|
||||
|
||||
feature -- Documentation
|
||||
|
||||
mapping_documentation (m: WSF_ROUTER_MAPPING): WSF_ROUTER_MAPPING_DOCUMENTATION
|
||||
mapping_documentation (m: WSF_ROUTER_MAPPING; a_request_methods: detachable WSF_REQUEST_METHODS): WSF_ROUTER_MAPPING_DOCUMENTATION
|
||||
deferred
|
||||
end
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ inherit
|
||||
|
||||
feature -- Documentation
|
||||
|
||||
documentation: WSF_ROUTER_MAPPING_DOCUMENTATION
|
||||
documentation (a_request_methods: detachable WSF_REQUEST_METHODS): WSF_ROUTER_MAPPING_DOCUMENTATION
|
||||
do
|
||||
if attached {WSF_SELF_DOCUMENTED_HANDLER} handler as obj then
|
||||
Result := obj.mapping_documentation (Current)
|
||||
Result := obj.mapping_documentation (Current, a_request_methods)
|
||||
else
|
||||
create Result.make (Current)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user