I am wondering if it is possible to change a schema definition of a feature layer in Portal for ArcGIS (for example changing the name of an alias, or adding a domain value). In ArcGIS Online this is definitely possible e.g. see:
But if you follow the same steps in Portal, it does not work. So the steps are to insert "admin" in the URL i.e go the service URL, and add /admin/ between /rest/ and /services/. In Portal when you do this, just as in AGOL you indeed get to an admin page for the service, and at the bottom you can click on "Update Layer Definition". However in Portal, in the box for JSON, the existing GeoJSON for the service definition is not displayed (this is unlike AGOL where the JSON is displayed).
I went back to the original service URL (i.e. before adding "admin" to the URL string) and clicked on the json link at the top of the page and pasted that in the "Update Layer Definition" box. But that json is not correct and gives you an error. In fact the json for the service obtained that way is very different from the json provided in the "Update Layer Definition" box by default in AGOL.
So my question is, is there any way to update a service definition for a hosted feature layer in Portal for ArcGIS? If there is a programmatic way using the arcgis.gis libraries that is fine too - I tried that as well but here again could not get to the right json to do the update.