[NETCONF-972] yanglib does not support RFC6020 media types Created: 07/Mar/23  Updated: 21/Jun/23  Resolved: 09/Mar/23

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: 3.0.0, 4.0.0, 5.0.0, 3.0.8, 4.0.5, 5.0.3
Fix Version/s: 3.0.9, 4.0.6, 5.0.4

Type: Bug Priority: High
Reporter: Robert Varga Assignee: Ivan Hrasko
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks NETCONF-973 Default application/yang in yanglib Resolved
blocks NETCONF-974 Support YIN sources in yanglib Confirmed
Relates
relates to NETCONF-968 YangLib: reduntant '/' for models wit... Resolved

 Description   

YangLibService service defines the following:

    /**
     * Get module's source for each module from yang library.
     * @param name Module's name
     * @param revision Module's revision
     * @return Module's source
     */
    @GET
    @Produces("text/plain")
    @Path("/schemas/{modelName}/{revision:([0-9\\-]*)}")
    String getSchema(@PathParam("modelName") String name, @PathParam("revision") String revision);

This is rather wrong: what we are serving is YANG files, which in turn means we should be producing application/yang. This constant is available as YangConstants.RFC6020_YANG_MEDIA_TYPE.

Fix this up so we produce either, returning text/plain when not otherwise specified.


Generated at Wed Feb 07 20:16:22 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.